Commit b748823ddfa1b2b9a3161c46fbefed8c88ccde41
1 parent
94a22ccdaa
Exists in
master
delta
Showing 1 changed file with 5 additions and 1 deletions Side-by-side Diff
matrix-util.js
... | ... | @@ -125,12 +125,15 @@ MatrixUtil.prototype.isPartnerOffline = function(partner) { |
125 | 125 | |
126 | 126 | MatrixUtil.prototype._updateLastResponseTime = function(partner) { |
127 | 127 | let matrix = this.matrix; |
128 | + let logger = this.logger; | |
128 | 129 | |
129 | 130 | if (!matrix.buddies[partner]['last_outgoing']) { |
131 | + logger.verbose('No outgoing yet, skip updateLastResponseTime'); | |
130 | 132 | return; |
131 | 133 | } |
132 | 134 | |
133 | 135 | if (!matrix.buddies[partner]['last_outgoing'].last_update_ts) { |
136 | + logger.verbose('No outgoing timestamp yet, skip updateLastResponseTime'); | |
134 | 137 | return; |
135 | 138 | } |
136 | 139 | |
... | ... | @@ -141,7 +144,8 @@ MatrixUtil.prototype._updateLastResponseTime = function(partner) { |
141 | 144 | return; |
142 | 145 | } |
143 | 146 | |
144 | - matrix.buddies[partner]['last_response_time'] = Math.round((Date.now() - matrix.buddies[partner]['last_outgoing']['last_update_ts'])/1000); | |
147 | + let delta = Date.now() - matrix.buddies[partner]['last_outgoing']['last_update_ts']; | |
148 | + matrix.buddies[partner]['last_response_time'] = Math.round(delta/1000); | |
145 | 149 | } |
146 | 150 | |
147 | 151 | MatrixUtil.prototype._updateLastMessage = function(partner, msg, direction) { |