Commit 3b71ec6743f184e1c02758a080157e73b6d1d305
1 parent
b748823ddf
Exists in
master
coba
Showing 1 changed file with 4 additions and 3 deletions Side-by-side Diff
matrix-util.js
... | ... | @@ -132,19 +132,20 @@ MatrixUtil.prototype._updateLastResponseTime = function(partner) { |
132 | 132 | return; |
133 | 133 | } |
134 | 134 | |
135 | - if (!matrix.buddies[partner]['last_outgoing'].last_update_ts) { | |
135 | + if (!matrix.buddies[partner]['last_outgoing']['last_update_ts']) { | |
136 | 136 | logger.verbose('No outgoing timestamp yet, skip updateLastResponseTime'); |
137 | 137 | return; |
138 | 138 | } |
139 | 139 | |
140 | 140 | if ( |
141 | 141 | matrix.buddies[partner]['last_incoming'] |
142 | - && (matrix.buddies[partner]['last_incoming']['last_update_ts'] > matrix.buddies[partner]['last_outgoing']['last_update_ts']) | |
142 | + && (Number(matrix.buddies[partner]['last_incoming']['last_update_ts']) > Number(matrix.buddies[partner]['last_outgoing']['last_update_ts'])) | |
143 | 143 | ) { |
144 | 144 | return; |
145 | 145 | } |
146 | 146 | |
147 | - let delta = Date.now() - matrix.buddies[partner]['last_outgoing']['last_update_ts']; | |
147 | + let delta = Date.now() - Number(matrix.buddies[partner]['last_outgoing']['last_update_ts']); | |
148 | + logger.verbose('Response time in ' + delta + 'ms'); | |
148 | 149 | matrix.buddies[partner]['last_response_time'] = Math.round(delta/1000); |
149 | 150 | } |
150 | 151 |