Fixed diagnostic agent 'log', to write log to correct ID

Bryan Roe committed Apr 12, 2019 at 13:24 UTC e2cbc729c226647a660c3fa71f0475599987e8a1
1 file changed +3 -2
meshagent.js
+3 -2
@@ -1134,9 +1134,10 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
1134 }
1135 case 'log': {
1136 // Only the diagnostic agent can do
1137 - if (((obj.agentInfo.capabilities & 0x40) != 0) && (typeof command.value.command.value == 'string') && (command.value.command.value.length < 256)) {
1137 + if (((obj.agentInfo.capabilities & 0x40) != 0) && (typeof command.value.value == 'string') && (command.value.value.length < 256))
1138 + {
1139 // Log a value in the event log of the main again
1139 - var event = { etype: 'node', action: 'diagnostic', nodeid: obj.dbNodeKey, domain: domain.id, msg: command.value.command.value };
1140 + var event = { etype: 'node', action: 'diagnostic', nodeid: obj.realNodeKey, domain: domain.id, msg: command.value.value };
1141 parent.parent.DispatchEvent(['*', obj.dbMeshKey], obj, event);
1142 }
1143 break;