diff src/core/xmpp.py @ 726:ade9997fabfa

core: use of Twisted JID instead of string bare jid in roster SatRosterProtocol
author Goffi <goffi@goffi.org>
date Tue, 10 Dec 2013 17:25:31 +0100
parents 0c84fb112d70
children b26dfac8e46c
line wrap: on
line diff
--- a/src/core/xmpp.py	Tue Dec 03 13:51:08 2013 +0100
+++ b/src/core/xmpp.py	Tue Dec 10 17:25:31 2013 +0100
@@ -218,7 +218,7 @@
         info(_("new contact in roster list: %s"), item.jid.full())
         #self.host.memory.addContact(item.jid, item_attr, item.groups, self.parent.profile)
 
-        bare_jid = item.jid.userhost()
+        bare_jid = item.jid.userhostJID()
         self._jids[bare_jid] = item
         for group in item.groups:
             self._groups.setdefault(group, set()).add(bare_jid)
@@ -227,7 +227,7 @@
     def onRosterRemove(self, entity):
         """Called when a roster removal event is received"""
         print _("removing %s from roster list") % entity.full()
-        bare_jid = entity.userhost()
+        bare_jid = entity.userhostJID()
 
         # we first remove item from local cache (self._groups and self._jids)
         try:
@@ -256,7 +256,7 @@
         """Return RosterItem for a given jid
         @param jid: jid of the contact
         @return: RosterItem or None if contact is not in cache"""
-        return self._jids.get(jid.userhost(), None)
+        return self._jids.get(jid.userhostJID(), None)
 
     def getBareJids(self):
         """Return all bare jids (as unicode) of the roster"""
@@ -264,7 +264,7 @@
 
     def isJidInRoster(self, entity_jid):
         """Return True if jid is in roster"""
-        return entity_jid.userhost() in self._jids
+        return entity_jid.userhostJID() in self._jids
 
     def getItems(self):
         """Return all items of the roster"""