mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-03-09 15:40:18 +00:00
Added device help request messaging notification support.
This commit is contained in:
parent
1a6e78efed
commit
fbde2a87a5
2 changed files with 23 additions and 7 deletions
|
@ -442,6 +442,7 @@ module.exports.CreateServer = function (parent) {
|
|||
if (to == null) return;
|
||||
parent.debug('email', "Sending device state change message to " + to);
|
||||
|
||||
// Format the message
|
||||
var sms = [];
|
||||
if (connections.length > 0) { sms.push('Connections: ' + connections.join(', ')); } // TODO: Translate 'Connections: '
|
||||
if (disconnections.length > 0) { sms.push('Disconnections: ' + disconnections.join(', ')); } // TODO: Translate 'Disconnections: '
|
||||
|
@ -453,6 +454,19 @@ module.exports.CreateServer = function (parent) {
|
|||
obj.sendMessage(to, sms, domain, null);
|
||||
};
|
||||
|
||||
// Send help request notification
|
||||
obj.sendDeviceHelpRequest = function (domain, username, to, devicename, nodeid, helpusername, helprequest, lang) {
|
||||
if (to == null) return;
|
||||
parent.debug('email', "Sending device help request message to " + to);
|
||||
|
||||
// Format the message
|
||||
var sms = "Help Request from " + devicename + ': ' + helprequest; // TODO: Translate 'Help Request from {0}:'
|
||||
if (sms.length > 1000) { sms = sms.substring(0, 997) + '...'; } // Limit messages to 1000 characters
|
||||
|
||||
// Send the message
|
||||
obj.sendMessage(to, sms, domain, null);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Device connetion and disconnection notifications
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue