Skip to content

Commit

Permalink
Merge pull request #2997 from reyemxela/msgRepeatCalls
Browse files Browse the repository at this point in the history
Add repeatCalls option
  • Loading branch information
gfwilliams authored Sep 6, 2023
2 parents e2d8a23 + a7adfe7 commit 2708cab
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions apps/messages/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
0.58: show/hide "messages" widget directly, instead of through library stub
0.59: fixes message timeout by using setinterval, as it was intended. So the buzz is triggered every x seconds until the timeout occours.
0.60: Bump version to allow new buzz.js module to be loaded - fixes memory/performance hog when buzz called
0.61: Add repeatCalls option to allow different repeat settings for messages vs calls
4 changes: 3 additions & 1 deletion apps/messages/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,16 +204,18 @@ exports.buzz = function(msgSrc) {
if ((require("Storage").readJSON("setting.json", 1) || {}).quiet) return Promise.resolve(); // never buzz during Quiet Mode
const msgSettings = require("Storage").readJSON("messages.settings.json", true) || {};
let pattern;
let repeat;
if (msgSrc && msgSrc.toLowerCase()==="phone") {
// special vibration pattern for incoming calls
pattern = msgSettings.vibrateCalls;
repeat = msgSettings.repeatCalls;
} else {
pattern = msgSettings.vibrate;
repeat = msgSettings.repeat;
}
if (pattern===undefined) { pattern = ":"; } // pattern may be "", so we can't use || ":" here
if (!pattern) return Promise.resolve();

let repeat = msgSettings.repeat;
if (repeat===undefined) repeat = 4; // repeat may be zero
if (repeat)
{
Expand Down
2 changes: 1 addition & 1 deletion apps/messages/metadata.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "messages",
"name": "Messages",
"version": "0.60",
"version": "0.61",
"description": "Library to handle, load and store message events received from Android/iOS",
"icon": "app.png",
"type": "module",
Expand Down
7 changes: 7 additions & 0 deletions apps/messages/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
if (settings.vibrate===undefined) settings.vibrate=":";
if (settings.vibrateCalls===undefined) settings.vibrateCalls=":";
if (settings.repeat===undefined) settings.repeat=4;
if (settings.repeatCalls===undefined) settings.repeatCalls=settings.repeat;
if (settings.vibrateTimeout===undefined) settings.vibrateTimeout=60;
if (settings.unreadTimeout===undefined) settings.unreadTimeout=60;
if (settings.maxMessages===undefined) settings.maxMessages=3;
Expand Down Expand Up @@ -33,6 +34,12 @@
format: v => v?v+"s":/*LANG*/"Off",
onchange: v => updateSetting("repeat", v)
},
/*LANG*/'Repeat for calls': {
value: settings().repeatCalls,
min: 0, max: 10,
format: v => v?v+"s":/*LANG*/"Off",
onchange: v => updateSetting("repeatCalls", v)
},
/*LANG*/'Vibrate timer': {
value: settings().vibrateTimeout,
min: 0, max: settings().maxUnreadTimeout, step : 10,
Expand Down

0 comments on commit 2708cab

Please sign in to comment.