bug fix for an "read" status not being sent in case of deleted messages

This commit is contained in:
or-else
2018-01-09 15:13:57 -08:00
parent 1b9b7a2671
commit e5c98ba2d1
+2 -1
View File
@@ -2779,7 +2779,6 @@
// console.log("topic subscriptions updated"); // console.log("topic subscriptions updated");
}, },
handleNewMessage: function(msg) { handleNewMessage: function(msg) {
clearTimeout(this.readTimer);
// Regenerate messages list // Regenerate messages list
var topic = Tinode.getTopic(this.state.topic); var topic = Tinode.getTopic(this.state.topic);
var newState = {messages: []}; var newState = {messages: []};
@@ -2791,6 +2790,8 @@
// msg could be null if one or more messages were deleted. // msg could be null if one or more messages were deleted.
if (msg && !msg.deleted) { if (msg && !msg.deleted) {
clearTimeout(this.readTimer);
// If the message is added to the end of the message list, // If the message is added to the end of the message list,
// scroll to the bottom. // scroll to the bottom.
if (topic.isNewMessage(msg.seq)) { if (topic.isNewMessage(msg.seq)) {