mirror of
https://github.com/maunium/stickerpicker
synced 2024-12-21 06:30:43 +00:00
Send empty response to visibility action
This commit is contained in:
parent
89861f8a2c
commit
df75622fda
1 changed files with 12 additions and 9 deletions
|
@ -23,19 +23,22 @@ window.onmessage = event => {
|
|||
widgetId = request.widgetId
|
||||
}
|
||||
|
||||
window.parent.postMessage({
|
||||
...request,
|
||||
response: request.action === "capabilities" ? {
|
||||
capabilities: ["m.sticker"],
|
||||
} : {
|
||||
error: { message: "Action not supported" },
|
||||
},
|
||||
}, event.origin)
|
||||
let response
|
||||
|
||||
if (request.action === "visibility") {
|
||||
response = {}
|
||||
} else if (request.action === "capabilities") {
|
||||
response = { capabilities: ["m.sticker"] }
|
||||
} else {
|
||||
response = { error: { message: "Action not supported" } }
|
||||
}
|
||||
|
||||
window.parent.postMessage({ ...request, response }, event.origin)
|
||||
}
|
||||
|
||||
export function sendSticker(content) {
|
||||
const data = {
|
||||
content: {...content},
|
||||
content: { ...content },
|
||||
// `name` is for Element Web (and also the spec)
|
||||
// Element Android uses content -> body as the name
|
||||
name: content.body,
|
||||
|
|
Loading…
Reference in a new issue