diff frontends/src/primitivus/primitivus @ 503:10119c2a9d33

Primitivus: new entities are added to contact list if they send messages + QuickFrontend: names fixes
author Goffi <goffi@goffi.org>
date Wed, 26 Sep 2012 00:38:41 +0200
parents e9634d2e7b38
children f98bef71a918
line wrap: on
line diff
--- a/frontends/src/primitivus/primitivus	Tue Sep 25 23:10:22 2012 +0200
+++ b/frontends/src/primitivus/primitivus	Wed Sep 26 00:38:41 2012 +0200
@@ -308,8 +308,13 @@
     def newMessage(self, from_jid, msg, type, to_jid, profile):
         if not self.check_profile(profile):
             return
+        sender = JID(from_jid)
+        if not sender in self.contact_list and sender.short != self.profiles[profile]['whoami'].short:
+            #XXX: needed to show entities which haven't sent any
+            #     presence information and which are not in roster
+            #TODO: put these entities in a "not in roster" list
+            self.contact_list.replace(sender)
         QuickApp.newMessage(self, from_jid, msg, type, to_jid, profile)
-        sender = JID(from_jid)
         if JID(self.contact_list.selected).short != sender.short:
             self.contact_list.putAlert(sender)