X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Fsimple_presence.py;h=c71a5c249fb65c401c44f2eed81a9250267f2330;hb=afa4cdb64e451070cf87cc02f257c582fa057f53;hp=bda9fedce112fdfd2a86b6175083d20ae189a398;hpb=5e4f5b50cd8eaacfd47c8082125b984a890bf150;p=theonering diff --git a/src/simple_presence.py b/src/simple_presence.py index bda9fed..c71a5c2 100644 --- a/src/simple_presence.py +++ b/src/simple_presence.py @@ -1,5 +1,6 @@ import logging +import dbus import telepathy import util.misc as misc_utils @@ -20,10 +21,10 @@ class TheOneRingPresence(object): OFFLINE = 'offline' TO_PRESENCE_TYPE = { - ONLINE: telepathy.constants.CONNECTION_PRESENCE_TYPE_AVAILABLE, - AWAY: telepathy.constants.CONNECTION_PRESENCE_TYPE_AWAY, - HIDDEN: telepathy.constants.CONNECTION_PRESENCE_TYPE_HIDDEN, - OFFLINE: telepathy.constants.CONNECTION_PRESENCE_TYPE_OFFLINE, + ONLINE: dbus.UInt32(telepathy.constants.CONNECTION_PRESENCE_TYPE_AVAILABLE), + AWAY: dbus.UInt32(telepathy.constants.CONNECTION_PRESENCE_TYPE_AWAY), + HIDDEN: dbus.UInt32(telepathy.constants.CONNECTION_PRESENCE_TYPE_HIDDEN), + OFFLINE: dbus.UInt32(telepathy.constants.CONNECTION_PRESENCE_TYPE_OFFLINE), } @property @@ -104,9 +105,12 @@ class SimplePresenceMixin(tp.ConnectionInterfaceSimplePresence, TheOneRingPresen @return {ContactHandle: (Status, Presence Type, Message)} """ personalMessage = u"" - return dict( - (h, (presenceType, presence, personalMessage)) - for (h, (presenceType, presence)) in self.get_presences(contacts).iteritems() + return dbus.Dictionary( + ( + (h, dbus.Struct((presenceType, presence, personalMessage), signature="uss")) + for (h, (presenceType, presence)) in self.get_presences(contacts).iteritems() + ), + signature="u(uss)" ) @misc_utils.log_exception(_moduleLogger)