fix reports missing multiplex desktop sessions #6445

Signed-off-by: si458 <simonsmith5521@gmail.com>

si458 committed Oct 12, 2024 at 02:53 UTC 5a0d3054b8cdf54eca6b0640d97f52032ad6b1f4
1 file changed +3 -1
meshuser.js
+3 -1
@@ -6594,7 +6594,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
6594 const manageAllDeviceGroups = ((user.siteadmin == 0xFFFFFFFF) && (parent.parent.config.settings.managealldevicegroups.indexOf(user._id) >= 0));
6595 if ((command.devGroup != null) && (manageAllDeviceGroups == false) && ((user.links == null) || (user.links[command.devGroup] == null))) return; // Asking for a device group that is not allowed
6596
6597 - const msgIdFilter = [5, 10, 11, 12, 122, 123, 124, 125, 126];
6597 + const msgIdFilter = [5, 10, 11, 12, 122, 123, 124, 125, 126, 144];
6598 switch (command.type) {
6599 case 1: {
6600 remoteSessionReport(command, manageAllDeviceGroups, msgIdFilter);
@@ -7714,6 +7714,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
7714 // Session length
7715 if (((docs[i].msgid >= 10) && (docs[i].msgid <= 12)) && (docs[i].msgArgs != null) && (typeof docs[i].msgArgs == 'object') && (typeof docs[i].msgArgs[3] == 'number')) { entry.length = docs[i].msgArgs[3]; }
7716 else if ((docs[i].msgid >= 122) && (docs[i].msgid <= 126) && (docs[i].msgArgs != null) && (typeof docs[i].msgArgs == 'object') && (typeof docs[i].msgArgs[0] == 'number')) { entry.length = docs[i].msgArgs[0]; }
7717 + else if ((docs[i].msgid == 144) && (docs[i].msgArgs != null) && (typeof docs[i].msgArgs == 'object') && (typeof docs[i].msgArgs[1] == 'number')) { entry.length = docs[i].msgArgs[1]; }
7718
7719 if (command.groupBy == 1) { // Add entry to per user
7720 if (data.groups[docs[i].userid] == null) { data.groups[docs[i].userid] = { entries: [] }; }
@@ -7780,6 +7781,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
7781 // Session length
7782 if (((docs[i].msgid >= 10) && (docs[i].msgid <= 12)) && (docs[i].msgArgs != null) && (typeof docs[i].msgArgs == 'object') && (typeof docs[i].msgArgs[3] == 'number')) { userEntry.length += docs[i].msgArgs[3]; }
7783 else if ((docs[i].msgid >= 122) && (docs[i].msgid <= 126) && (docs[i].msgArgs != null) && (typeof docs[i].msgArgs == 'object') && (typeof docs[i].msgArgs[0] == 'number')) { userEntry.length += docs[i].msgArgs[0]; }
7784 + else if ((docs[i].msgid == 144) && (docs[i].msgArgs != null) && (typeof docs[i].msgArgs == 'object') && (typeof docs[i].msgArgs[1] == 'number')) { userEntry.length += docs[i].msgArgs[1]; }
7785
7786 // Set the user entry
7787 userEntries[docs[i].userid] = userEntry;