Commit cf811f203d926ba05ab306174371247c495e2b9f

Authored by Adhidarma Hadiwinoto
1 parent f74e655239
Exists in master

lastStateUpdate

Showing 2 changed files with 6 additions and 3 deletions Side-by-side Diff

1 1 var xmpp = require('simple-xmpp');
  2 +var moment = require('moment');
2 3  
3 4 var username;
4 5 var password;
... ... @@ -46,12 +47,13 @@ function onBuddy(jid, state, statusText, resource) {
46 47 }
47 48  
48 49 if (!matrix.buddies[jid]) {
49   - matrix.buddies[jid] = {};
  50 + matrix.buddies[jid] = {states: {}};
50 51 }
51 52  
52   - matrix.buddies[jid][resource] = {
  53 + matrix.buddies[jid].states.[resource] = {
53 54 state: state,
54   - statusText: statusText
  55 + statusText: statusText,
  56 + lastStateUpdate: moment().format('YYYYMMdd HH:mm:ss')
55 57 }
56 58 }
57 59  
... ... @@ -21,6 +21,7 @@
21 21 "author": "Adhidarma Hadiwinoto <me@adhisimon.org>",
22 22 "license": "ISC",
23 23 "dependencies": {
  24 + "moment": "^2.15.2",
24 25 "sate24": "git+http://gitlab.kodesumber.com/reload97/node-sate24.git",
25 26 "sate24-expresso": "git+http://gitlab.kodesumber.com/reload97/sate24-expresso.git",
26 27 "simple-xmpp": "^1.3.0"