Fix iOS stickers by adding widgetData to callAction

This commit is contained in:
Tony Stipanic 2021-12-02 20:15:59 +01:00
parent 2fb719f7fd
commit 835c95e6e2
No known key found for this signature in database
GPG Key ID: 3026BCCB6C9CC6BD

View File

@ -39,8 +39,7 @@ export class ScalarWidgetApi {
} }
public static sendSticker(sticker: FE_Sticker, pack: FE_StickerPack): void { public static sendSticker(sticker: FE_Sticker, pack: FE_StickerPack): void {
ScalarWidgetApi.callAction("m.sticker", { const payload = {
data: {
description: sticker.description, description: sticker.description,
content: { content: {
// Element Android requires content.body to contain the sticker description, otherwise // Element Android requires content.body to contain the sticker description, otherwise
@ -65,7 +64,11 @@ export class ScalarWidgetApi {
}, },
}, },
}, },
}, };
ScalarWidgetApi.callAction("m.sticker", {
data: payload,
// This is needed for Element iOS to work as it uses widgetData
widgetData: payload,
}); });
} }