From 49247180dc0791f703e81b19ee3816996175a98f Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Wed, 28 May 2014 01:32:27 +0000 Subject: [PATCH] Add lastSeen and identity to member record if not present. --- netconf-service/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/netconf-service/index.js b/netconf-service/index.js index 494e819fa..f9a48e5af 100644 --- a/netconf-service/index.js +++ b/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'])