diff src/core/xmpp.py @ 501:e9634d2e7b38

core, quick_frontend, primitivus, wix: Contacts List refactoring phase 1: - QuickContactManagement is not used anymore and will be removed, ContactList + Core are used instead - disconnected contacts are now displayed in Primitivus (M-d to show/hide them) - avatars are temporary unavailable in wix - new bridge method: getContactsFromGroup
author Goffi <goffi@goffi.org>
date Tue, 25 Sep 2012 00:58:34 +0200
parents e789917fb59d
children 862c0d6ab974
line wrap: on
line diff
--- a/src/core/xmpp.py	Wed Sep 05 00:19:32 2012 +0200
+++ b/src/core/xmpp.py	Tue Sep 25 00:58:34 2012 +0200
@@ -23,6 +23,7 @@
 from twisted.words.protocols.jabber import jid, xmlstream
 from wokkel import client, disco, xmppim, generic, compat
 from logging import debug, info, error
+from sat.core import exceptions
 
 
 class SatXMPPClient(client.XMPPClient):
@@ -164,9 +165,9 @@
         """Return dictionary of attributes as used in bridge from a RosterItem
         @param item: RosterItem
         @return: dictionary of attributes"""
-        item_attr = {'to': str(item.subscriptionTo),
-                     'from': str(item.subscriptionFrom),
-                     'ask': str(item.ask)
+        item_attr = {'to': unicode(item.subscriptionTo),
+                     'from': unicode(item.subscriptionFrom),
+                     'ask': unicode(item.ask)
                      }
         if item.name:
             item_attr['name'] = item.name
@@ -235,6 +236,12 @@
     def getItems(self):
         """Return all items of the roster"""
         return self._jids.values()
+
+    def getJidsFromGroup(self, group):
+        try:
+            return self._groups[group]
+        except KeyError:
+            return  exceptions.UnknownGroupError
         
 
 class SatPresenceProtocol(xmppim.PresenceClientProtocol):