forked from ProfessionalUwU/stickerpicker
Stop using ID field from telegram metadata in widget
This commit is contained in:
@ -143,7 +143,7 @@ const Pack = ({ pack }) => html`
|
||||
<h1>${pack.title}</h1>
|
||||
<div class="sticker-list">
|
||||
${pack.stickers.map(sticker => html`
|
||||
<${Sticker} key=${sticker["net.maunium.telegram.sticker"].id} content=${sticker}/>
|
||||
<${Sticker} key=${sticker.id} content=${sticker}/>
|
||||
`)}
|
||||
</div>
|
||||
</section>
|
||||
|
@ -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"]
|
||||
|
Reference in New Issue
Block a user