aboutsummaryrefslogtreecommitdiffstats
path: root/web/widget-api.js
diff options
context:
space:
mode:
authorTulir Asokan <tulir@maunium.net>2020-09-06 17:10:07 +0300
committerTulir Asokan <tulir@maunium.net>2020-09-06 17:10:07 +0300
commit4ce90892f0df459361ffceaf59ff5a1624954b87 (patch)
treef3689d839680907a190573941a58a3f5f2e8431b /web/widget-api.js
parent522e45a4ae0766aeeaa7c16f45f7d563026da84e (diff)
Stop using ID field from telegram metadata in widget
Diffstat (limited to 'web/widget-api.js')
-rw-r--r--web/widget-api.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/web/widget-api.js b/web/widget-api.js
index 6d81107..8787262 100644
--- a/web/widget-api.js
+++ b/web/widget-api.js
@@ -35,17 +35,19 @@ window.onmessage = event => {
export function sendSticker(content) {
const data = {
- content,
+ content: {...content},
// `name` is for Element Web (and also the spec)
// Element Android uses content -> body as the name
name: content.body,
}
+ // Custom field that stores the ID even for non-telegram stickers
+ delete data.content.id
// This is for Element iOS
const widgetData = {
...data,
description: content.body,
- file: `${content["net.maunium.telegram.sticker"].id}.png`,
+ file: `${content.id}.png`,
}
// Element iOS explodes if there are extra fields present
delete widgetData.content["net.maunium.telegram.sticker"]
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage