primitivus: fixed double messages discarding

This commit is contained in:
Goffi 2012-10-21 13:23:21 +02:00
commit 7b62c7eef1

View file

@ -251,9 +251,9 @@ class Chat(urwid.WidgetWrap, QuickChat):
continue #the new message is older, we need to insert it upper
#we discard double messages, to avoid backlog / history conflict
if idx and self.content[idx-1].message == msg:
return
if idx<len(self.content)-2 and self.content[idx+1].message == msg:
if ((idx and self.content[idx-1].message == msg) or
(self.content[idx].message == msg) or
(idx<len(self.content)-2 and self.content[idx+1].message)):
return
self.content.insert(idx+1, new_text)