소스 검색

Add lastSeen and identity to member record if not present.

Adam Ierymenko 11 년 전
부모
커밋
49247180dc
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      netconf-service/index.js

+ 4 - 0
netconf-service/index.js

@@ -310,6 +310,10 @@ function doNetconfRequest(message)
 					'lastSeen': Date.now(),
 					'lastSeen': Date.now(),
 					'authorized': authorized ? '1' : '0' // reset authorized to unhide in UI, since UI uses -1 to hide
 					'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'])
 				if (message.data['from'])
 					updatedFields['lastAt'] = message.data['from'];
 					updatedFields['lastAt'] = message.data['from'];
 				if (message.data['clientVersion'])
 				if (message.data['clientVersion'])