Skip to content

Commit

Permalink
onMessageExternal listener added to respond to presence pings
Browse files Browse the repository at this point in the history
  • Loading branch information
micz committed Jan 11, 2025
1 parent d8787bf commit 28aa643
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions mztas-background.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,23 @@ browser.runtime.onMessage.addListener((message, sender, sendResponse) => {
console.log("Message received:", message);
console.log("Sender info:", sender);

sendResponse({ response: "Message received successfully!" });

switch (message.action) {
case "openCalendarDialog":
browser.CalendarTools.openCalendarDialog(message.data);
break;
}

return true;
});
});

browser.runtime.onMessageExternal.addListener((message, sender, sendResponse) => {
console.log("Message received:", message);
console.log("Sender info:", sender);

switch (message.action) {
case "checkPresence":
return Promise.resolve("ok");
}

return true;
});

0 comments on commit 28aa643

Please sign in to comment.