aboutsummaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
Diffstat (limited to 'web')
-rw-r--r--web/widget-api.js21
1 files changed, 12 insertions, 9 deletions
diff --git a/web/widget-api.js b/web/widget-api.js
index 8787262..3efca0e 100644
--- a/web/widget-api.js
+++ b/web/widget-api.js
@@ -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,
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage