diff frontends/quick_frontend/quick_app.py @ 124:961e0898271f

primitivus chat window - management of one 2 one / group chat - timestamp displayed - added shortcuts for showing/hiding panels - color used - fixed vcard bug (contact displayed even if not from current profile if vcard changed/not in cache) - added VerticalSeparator widget - *List widgets can now use an other widget than SelectableText - new UnselectableText widget
author Goffi <goffi@goffi.org>
date Thu, 08 Jul 2010 19:47:54 +0800
parents ded2431cea5a
children 8d611eb9ae48
line wrap: on
line diff
--- a/frontends/quick_frontend/quick_app.py	Thu Jul 08 18:29:44 2010 +0800
+++ b/frontends/quick_frontend/quick_app.py	Thu Jul 08 19:47:54 2010 +0800
@@ -249,7 +249,7 @@
         self.chat_wins[room_jid].setUserNick(user_nick)
         self.chat_wins[room_jid].setType("group")
         self.chat_wins[room_jid].id = room_jid
-        self.chat_wins[room_jid].setPresents([user_nick]+room_nicks)
+        self.chat_wins[room_jid].setPresents(list(set([user_nick]+room_nicks)))
 
 
     def roomUserJoined(self, room_id, room_service, user_nick, user_data, profile):
@@ -387,13 +387,15 @@
     def updatedValue(self, name, data):
         if name == "card_nick":
             target = JID(data['jid'])
-            self.CM.update(target, 'nick', data['nick'])
-            self.contactList.replace(target)
+            if target in self.contactList:
+                self.CM.update(target, 'nick', data['nick'])
+                self.contactList.replace(target)
         elif name == "card_avatar":
             target = JID(data['jid'])
-            filename = self.bridge.getAvatarFile(data['avatar'])
-            self.CM.update(target, 'avatar', filename)
-            self.contactList.replace(target)
+            if target in self.contactList:
+                filename = self.bridge.getAvatarFile(data['avatar'])
+                self.CM.update(target, 'avatar', filename)
+                self.contactList.replace(target)
 
     def askConfirmation(self, type, id, data):
         raise NotImplementedError