summaryrefslogtreecommitdiff
path: root/src/roster.py
diff options
context:
space:
mode:
authorlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-11-10 21:15:08 +0000
committerlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-11-10 21:15:08 +0000
commit545902be7d625f29d00eceb1707afa36af20d137 (patch)
treec16da52b478c664560ec2e6b4008ca56d6a574f2 /src/roster.py
parent0f39961a5d12ecad0e8311c1f6eb6d54de3423ee (diff)
downloadpoezio-545902be7d625f29d00eceb1707afa36af20d137.tar.gz
poezio-545902be7d625f29d00eceb1707afa36af20d137.tar.bz2
poezio-545902be7d625f29d00eceb1707afa36af20d137.tar.xz
poezio-545902be7d625f29d00eceb1707afa36af20d137.zip
ConversationTab interface
Diffstat (limited to 'src/roster.py')
-rw-r--r--src/roster.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/roster.py b/src/roster.py
index 09bc7b6b..610d73dc 100644
--- a/src/roster.py
+++ b/src/roster.py
@@ -18,9 +18,12 @@
"""
Defines the Roster and RosterGroup classes
"""
+import logging
+log = logging.getLogger(__name__)
from config import config
from contact import Contact, Resource
+from sleekxmpp.xmlstream.stanzabase import JID
class Roster(object):
def __init__(self):
@@ -47,8 +50,10 @@ class Roster(object):
"""
Returns the contact with the given bare JID
"""
- if jid in self._contacts:
- return self._contacts[jid]
+ # Use only the bare jid
+ jid = JID(jid)
+ if jid.bare in self._contacts:
+ return self._contacts[jid.bare]
return None
def edit_groups_of_contact(self, contact, groups):
@@ -59,7 +64,7 @@ class Roster(object):
# add the contact to each group he is in
# If the contact hasn't any group, we put her in
# the virtual default 'none' group
- if not len(groups):
+ if not len(groups):
groups = ['none']
for group in groups:
if group not in contact._groups: