Inbound stickers (same as images)

This also covers sticons, but only when a single one is sent as the sole
content of a message, in which case it behaves like a sticker/image.
This commit is contained in:
Andrew Ferrazzutti 2021-04-02 03:21:30 -04:00
parent 4edf0cdaa5
commit 510018a51d
2 changed files with 12 additions and 3 deletions

View File

@ -18,7 +18,11 @@
* [ ] Audio
* [ ] Location
* [ ] Videos
* [ ] Stickers & special emoji
* [x] Stickers
* [ ] Sticons
* [x] Single
* [ ] Multiple or mixed with text
* [ ] EmojiOne
* [x] Notification for message send failure
* [ ] Read receipts
* [x] User metadata

View File

@ -212,9 +212,14 @@ class MautrixController {
}
const messageElement = element.querySelector(".mdRGT07Body > .mdRGT07Msg")
if (messageElement.classList.contains("mdRGT07Text")) {
// TODO Use "Inner" or not?
// TODO Use alt text of emojione imgs
messageData.text = messageElement.querySelector(".mdRGT07MsgTextInner")?.innerText
} else if (messageElement.classList.contains("mdRGT07Image")) {
// TODO HTML format for emojione imgs & sticons.
// Consider using a custom sticker pack (MSC1951)
} else if (
messageElement.classList.contains("mdRGT07Image") ||
messageElement.classList.contains("mdRGT07Sticker")
) {
const img = messageElement.querySelector(".mdRGT07MsgImg > img")
if (img) {
let resolve