Primitivus: avoid double messages in case of backlog/history conflict
This commit is contained in:
parent
65103362a6
commit
920931ce8b
1 changed files with 6 additions and 0 deletions
|
|
@ -241,6 +241,12 @@ class Chat(urwid.WidgetWrap, QuickChat):
|
|||
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:
|
||||
|
|
|
|||
Loading…
Reference in a new issue