Explorar o código

Add lastSeen and identity to member record if not present.

Adam Ierymenko %!s(int64=11) %!d(string=hai) anos
pai
achega
49247180dc
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      netconf-service/index.js

+ 4 - 0
netconf-service/index.js

@@ -310,6 +310,10 @@ function doNetconfRequest(message)
 					'lastSeen': Date.now(),
 					'authorized': authorized ? '1' : '0' // reset authorized to unhide in UI, since UI uses -1 to hide
 				};
+				if (!('identity' in member))
+					updatedFields['identity'] = peerId.toString();
+				if (!('firstSeen' in member))
+					updatedFields['firstSeen'] = Date.now();
 				if (message.data['from'])
 					updatedFields['lastAt'] = message.data['from'];
 				if (message.data['clientVersion'])