changeset 521:3f8c2a0f20e5

primitivus: fixed double messages discarding
author Goffi <goffi@goffi.org>
date Sun, 21 Oct 2012 13:23:21 +0200 (2012-10-21)
parents 4d7248f4c577
children 3446ce33247d
files frontends/src/primitivus/chat.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/frontends/src/primitivus/chat.py	Sun Oct 21 12:55:47 2012 +0200
+++ b/frontends/src/primitivus/chat.py	Sun Oct 21 13:23:21 2012 +0200
@@ -251,9 +251,9 @@
                     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)