Send empty response to visibility action

This commit is contained in:
Tulir Asokan 2020-09-10 15:19:58 +03:00
parent 89861f8a2c
commit df75622fda

View File

@ -23,14 +23,17 @@ window.onmessage = event => {
widgetId = request.widgetId widgetId = request.widgetId
} }
window.parent.postMessage({ let response
...request,
response: request.action === "capabilities" ? { if (request.action === "visibility") {
capabilities: ["m.sticker"], response = {}
} : { } else if (request.action === "capabilities") {
error: { message: "Action not supported" }, response = { capabilities: ["m.sticker"] }
}, } else {
}, event.origin) response = { error: { message: "Action not supported" } }
}
window.parent.postMessage({ ...request, response }, event.origin)
} }
export function sendSticker(content) { export function sendSticker(content) {