Make Element Desktop send telegram sticker info

Element Desktop removes additional properties in the sticker info, but
not the media info. Element Android removes them in both currently. This
commit moves the net.maunium.telegram.sticker property to the media
info. This can be combined with a change to mautrix-telegram that
bridges telegram-imported matrix stickers to matrix stickers.
This commit is contained in:
Charlotte 🦝 Delenk
2022-08-23 07:46:29 +01:00
parent 99ced8878a
commit 2fe1ea6c7f
2 changed files with 8 additions and 3 deletions

View File

@ -47,6 +47,11 @@ window.onmessage = event => {
}
export function sendSticker(content) {
if (content["info"]["net.maunium.telegram.sticker"] === undefined) {
// Old sticker, move the property to its new location
content["info"]["net.maunium.telegram.sticker"] = content["net.maunium.telegram.sticker"];
delete content["net.maunium.telegram.sticker"];
}
const data = {
content: { ...content },
// `name` is for Element Web (and also the spec)