Primitivus: new entities are added to contact list if they send messages + QuickFrontend: names fixes

This commit is contained in:
Goffi 2012-09-26 00:38:41 +02:00
commit 27b2eed139

View file

@ -308,8 +308,13 @@ class PrimitivusApp(QuickApp):
def newMessage(self, from_jid, msg, type, to_jid, profile):
if not self.check_profile(profile):
return
QuickApp.newMessage(self, from_jid, msg, type, to_jid, profile)
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)
if JID(self.contact_list.selected).short != sender.short:
self.contact_list.putAlert(sender)