Mercurial > libervia-backend
diff frontends/src/primitivus/chat.py @ 1751:77870d2e2902
primitivus (chat): duplicate message check is actually not needed when retrieving local MUC history is disabled
author | souliane <souliane@mailoo.org> |
---|---|
date | Wed, 16 Dec 2015 13:29:24 +0100 |
parents | 3a6cd1c14974 |
children | 2e2fb462729a |
line wrap: on
line diff
--- a/frontends/src/primitivus/chat.py Tue Dec 15 20:29:19 2015 +0100 +++ b/frontends/src/primitivus/chat.py Wed Dec 16 13:29:24 2015 +0100 @@ -306,24 +306,7 @@ @param extra (dict): extra data """ new_text = ChatText(self, timestamp, nick, my_message, message) - if timestamp and self.content: - for idx in range(len(self.content) - 1, -1, -1): - current_text = self.content[idx] - older = new_text.timestamp < current_text.timestamp - if older and idx > 0: - continue # the new message is older, we need to insert it upper - - # we discard double messages, to avoid backlog / history conflict - # FIXME: messages that have been sent several times will be displayed only once - if ((idx and self.content[idx - 1].message == message) or - (self.content[idx].message == message) or - (idx < len(self.content) - 2 and self.content[idx + 1].message)): - return - - self.content.insert(0 if older else idx + 1, new_text) - break - else: - self.content.append(new_text) + self.content.append(new_text) if not timestamp: # XXX: do not send notifications for each line of the history being displayed # FIXME: this must be changed in the future if the timestamp is passed with