From e39cd672ab63b4ebd6475189672e941bd3faea20 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Fri, 4 Jun 2021 11:15:51 -0700 Subject: [PATCH] Added agent notification internalization. --- agents/meshcore.js | 4 ++++ views/default.handlebars | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/agents/meshcore.js b/agents/meshcore.js index 12c14ced..ab8a66b0 100644 --- a/agents/meshcore.js +++ b/agents/meshcore.js @@ -2941,6 +2941,10 @@ function processConsoleCommand(cmd, args, rights, sessionid) { sendPeriodicServerUpdate(); break; } + case 'agentmsgx': { + try { mesh.SendCommand({ action: 'sessions', type: 'msg', value: { 0: { msg: "This is an old agent version, consider updating.", msgid: 117, icon: 3 } } }); } catch (ex) { } + break; + } case 'agentmsg': { if (args['_'].length == 0) { response = "Proper usage:\r\n agentmsg add \"[message]\" [iconIndex]\r\n agentmsg remove [index]\r\n agentmsg list"; // Display usage diff --git a/views/default.handlebars b/views/default.handlebars index 24c38928..c0aefc84 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -4309,6 +4309,7 @@ for (var i in node.sessions.msg) { var msg = i, icon = 5; if (typeof node.sessions.msg[i].msg == 'string') { msg = node.sessions.msg[i].msg; } + if ((typeof node.sessions.msg[i].msgid == 'number') && (eventsMessageId[node.sessions.msg[i].msgid] != null)) { msg = eventsMessageId[node.sessions.msg[i].msgid]; } if (typeof node.sessions.msg[i].icon == 'number') { icon = node.sessions.msg[i].icon; } if ((icon < 1) || (icon > 9)) { icon = 5; } x += '
' + EscapeHtml(msg) + '
'; @@ -12386,7 +12387,8 @@ 113: "Added push notification authentication device", 114: "Removed push notification authentication device", 115: "Added login token", - 116: "Removed login token" + 116: "Removed login token", + 117: "This is an old agent version, consider updating.xx" }; // Highlights the device being hovered