frontends: fixes bug with private message introduced with revision 1000 (6f1e03068b5f) + display messages from contacts not in roster

This commit is contained in:
souliane 2014-05-29 14:34:01 +02:00
commit f09fb76752
7 changed files with 49 additions and 30 deletions

View file

@ -269,7 +269,7 @@ class QuickApp(object):
else:
from_jid = new_jid
if new_jid not in self.contact_list:
self.contact_list.add(new_jid)
self.contact_list.add(new_jid, [C.GROUP_NOT_IN_ROSTER])
self.newMessage(from_jid, to_jid, msg, _type, extra, profile)

View file

@ -57,11 +57,16 @@ class QuickContactList(object):
def replace(self, jid, groups=None, attributes=None):
"""Add a contact to the list if doesn't exist, else update it.
This method can be called with groups=None for the purpose of updating
the contact's attributes (e.g. nickname). In that case, the groups
attribute must not be set to the default group but ignored. If not,
you may move your contact from its actual group(s) to the default one.
None value for 'groups' has a different meaning than [None] which is for the default group.
@param jid (JID)
@param groups (list): list of groups or None to ignore the groups membership.
@param attributes (dict)
XXX: None value for 'groups' has a different meaning than [None] which is for the default group.
"""
if attributes and 'name' in attributes:
self.setCache(jid, 'name', attributes['name'])