# HG changeset patch # User Goffi # Date 1350746670 -7200 # Node ID fe79a724e6fa60c81ef5eb4f285e8d6237f5ba0f # Parent 8ee9113d307b74595295f9521763e4d186ce5910 Primitivus: avoid double messages in case of backlog/history conflict diff -r 8ee9113d307b -r fe79a724e6fa frontends/src/primitivus/chat.py --- a/frontends/src/primitivus/chat.py Sat Oct 20 17:23:56 2012 +0200 +++ b/frontends/src/primitivus/chat.py Sat Oct 20 17:24:30 2012 +0200 @@ -241,6 +241,12 @@ jid,nick,mymess = QuickChat.printMessage(self, from_jid, msg, profile, timestamp) except TypeError: return + if timestamp: + for _chat_text in self.content: + if (msg == _chat_text.message and + timestamp - time.mktime(_chat_text.timestamp) < 5): + #we discard double messages, to avoid backlog / history conflict + return my_jid = self.host.profiles[profile]['whoami'] self.content.append(ChatText(self, timestamp or None, nick, mymess, msg)) if self.text_list.get_focus()[1] == len(self.content)-2: