Add refactoring and formatted text bridging

This commit is contained in:
Tulir Asokan
2017-11-27 21:35:32 +02:00
parent a6bd561c7c
commit 0a09816003
6 changed files with 301 additions and 32 deletions
+10
View File
@@ -13,6 +13,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
const sanitizeHTML = require("sanitize-html")
const TelegramPeer = require("./telegram-peer")
/**
@@ -134,6 +135,15 @@ class TelegramUser {
return this.app.putUser(this)
}
sendHTML(roomID, html) {
return this.intent.sendMessage(roomID, {
msgtype: "m.text",
format: "org.matrix.custom.html",
formatted_body: html,
body: sanitizeHTML(html),
})
}
sendText(roomID, text) {
return this.intent.sendText(roomID, text)
}