forked from FOSS/BangleApps
Merge pull request #3556 from WhelanB/reply-gadgetbridge
Support Gadgetbridge Canned Responsesmaster
commit
6f8871ca90
|
@ -36,4 +36,5 @@
|
|||
0.34: Implement API for activity tracks fetching (Recorder app logs).
|
||||
0.35: Implement API to enable/disable acceleration data tracking.
|
||||
0.36: Move from wrapper function to {} and let - faster execution at boot
|
||||
Allow `calendar-` to take an array of items to remove
|
||||
Allow `calendar-` to take an array of items to remove
|
||||
0.37: Support Gadgetbridge canned responses
|
|
@ -67,6 +67,9 @@
|
|||
title:event.name||/*LANG*/"Call", body:/*LANG*/"Incoming call\n"+event.number});
|
||||
require("messages").pushMessage(event);
|
||||
},
|
||||
"canned_responses_sync" : function() {
|
||||
require("Storage").writeJSON("replies.json", event.d);
|
||||
},
|
||||
// {"t":"alarm", "d":[{h:int,m:int,rep:int},... }
|
||||
"alarm" : function() {
|
||||
//wipe existing GB alarms
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"id": "android",
|
||||
"name": "Android Integration",
|
||||
"shortName": "Android",
|
||||
"version": "0.36",
|
||||
"version": "0.37",
|
||||
"description": "Display notifications/music/etc sent from the Gadgetbridge app on Android. This replaces the old 'Gadgetbridge' Bangle.js widget.",
|
||||
"icon": "app.png",
|
||||
"tags": "tool,system,messages,notifications,gadgetbridge",
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
0.01: New Library!
|
||||
0.02: Minor bug fixes
|
||||
0.02: Minor bug fixes
|
||||
0.03: Support Gadgetbridge canned responses
|
|
@ -46,11 +46,19 @@ exports.reply = function (options) {
|
|||
options.fileOverride || "replies.json",
|
||||
true
|
||||
) || [];
|
||||
|
||||
replies.forEach((reply) => {
|
||||
menu = Object.defineProperty(menu, reply.text, {
|
||||
var displayString = reply.disp ?? reply.text;
|
||||
var wrappedDisplayString = g.wrapString(displayString, 120);
|
||||
// Generally handles truncating nicely, but falls down in long runs of emoji since they count as one image
|
||||
if (wrappedDisplayString.length > 1) {
|
||||
displayString = wrappedDisplayString[0]+"...";
|
||||
}
|
||||
menu = Object.defineProperty(menu, displayString, {
|
||||
value: () => constructReply(options.msg ?? {}, reply.text, resolve, reject),
|
||||
});
|
||||
});
|
||||
|
||||
if (!keyboard) delete menu[/*LANG*/ "Compose"];
|
||||
|
||||
if (replies.length == 0) {
|
||||
|
@ -75,4 +83,4 @@ exports.reply = function (options) {
|
|||
E.showMenu(menu);
|
||||
}
|
||||
});
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{ "id": "reply",
|
||||
"name": "Reply Library",
|
||||
"version": "0.02",
|
||||
"version": "0.03",
|
||||
"description": "A library for replying to text messages via predefined responses or keyboard",
|
||||
"icon": "app.png",
|
||||
"type": "module",
|
||||
|
|
Loading…
Reference in New Issue