9 _moduleLogger = logging.getLogger('presence')
12 class PresenceMixin(telepathy.server.ConnectionInterfacePresence, simple_presence.TheOneRingPresence):
15 telepathy.server.ConnectionInterfacePresence.__init__(self)
16 simple_presence.TheOneRingPresence.__init__(self)
18 @gtk_toolbox.log_exception(_moduleLogger)
19 def GetStatuses(self):
20 # the arguments are in common to all on-line presences
24 (localType, (telepathyType, True, True, arguments))
25 for (localType, telepathyType) in self.TO_PRESENCE_TYPE.iteritems()
28 @gtk_toolbox.log_exception(_moduleLogger)
29 def RequestPresence(self, contactIds):
30 presences = self.__get_presences(contactIds)
31 self.PresenceUpdate(presences)
33 @gtk_toolbox.log_exception(_moduleLogger)
34 def GetPresence(self, contactIds):
35 return self.__get_presences(contactIds)
37 @gtk_toolbox.log_exception(_moduleLogger)
38 def SetStatus(self, statuses):
39 assert len(statuses) == 1
40 status, arguments = statuses.items()[0]
41 assert len(arguments) == 0
42 self.set_presence(status)
44 def __get_presences(self, contacts):
47 (h, (0, {presence: arguments}))
48 for (h, (presenceType, presence)) in self.get_presences(contacts).iteritems()