Skip to content

Commit

Permalink
Merge pull request #3628 from bobrippling/feat/call-stop-buzz
Browse files Browse the repository at this point in the history
messagegui: stop buzzing for a message when it's removed
  • Loading branch information
bobrippling authored Nov 4, 2024
2 parents fe24890 + bfeffa4 commit 99fd579
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion apps/android/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ exports.gbHandler = (event) => {
"musicinfo" : function() {
require("messages").pushMessage(Object.assign(event, {t:"modify",id:"music",title:"Music"}));
},
// {"t":"call","cmd":"incoming/end","name":"Bob","number":"12421312"})
// {"t":"call","cmd":"incoming/end/start/outgoing","name":"Bob","number":"12421312"})
"call" : function() {
Object.assign(event, {
t:event.cmd=="incoming"?"add":"remove",
Expand Down
3 changes: 2 additions & 1 deletion apps/messagegui/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,5 @@
0.80: Add ability to reply to messages if a reply library is installed and the message can be replied to
0.81: Fix issue stopping Music message for being marked as read
Make sure play button image is transparent
Add top-right menu to music playback to allow message to be deleted
Add top-right menu to music playback to allow message to be deleted
0.82: Stop buzzing when a message is removed (e.g. call answered)
6 changes: 6 additions & 0 deletions apps/messagegui/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,19 @@ exports.listener = function(type, msg) {
clearTimeout(exports.messageTimeout);
delete exports.messageTimeout;
}
if (type==="clearAll") {
require("messages").stopBuzz();
return;
}
if (msg.t==="remove") {
// we won't open the UI for removed messages, so make sure to delete it from flash
if (Bangle.MESSAGES) {
// we were waiting for exports.messageTimeout
require("messages").apply(msg, Bangle.MESSAGES);
if (!Bangle.MESSAGES.length) delete Bangle.MESSAGES;
}
if(type!=="music")
require("messages").stopBuzz();
return require("messages").save(msg); // always write removal to flash
}

Expand Down
2 changes: 1 addition & 1 deletion apps/messagegui/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "messagegui",
"name": "Message UI",
"shortName": "Messages",
"version": "0.81",
"version": "0.82",
"description": "Default app to display notifications from iOS and Gadgetbridge/Android",
"icon": "app.png",
"type": "app",
Expand Down

0 comments on commit 99fd579

Please sign in to comment.