import telepathy
+_moduleLogger = logging.getLogger("simple_presence")
+
+
class TheOneRingPresence(object):
ONLINE = 'available'
BUSY = 'dnd'
}
-class ButterflySimplePresence(telepathy.server.ConnectionInterfaceSimplePresence):
+class SimplePresenceMixin(telepathy.server.ConnectionInterfaceSimplePresence):
def __init__(self):
telepathy.server.ConnectionInterfaceSimplePresence.__init__(self)
self._implement_property_get(dbus_interface, {'Statuses' : self._get_statuses})
+ @property
+ def gvoice_backend(self):
+ """
+ @abstract
+ """
+ raise NotImplementedError()
+
def GetPresences(self, contacts):
"""
@todo Figure out how to know when its self and get whether busy or not
raise telepathy.errors.InvalidArgument
if status == TheOneRingPresence.ONLINE:
- self._conn.mark_dnd(True)
+ self.gvoice_backend.mark_dnd(True)
elif status == TheOneRingPresence.BUSY:
- self._conn.mark_dnd(False)
+ self.gvoice_backend.mark_dnd(False)
else:
raise telepathy.errors.InvalidArgument
- logging.info("Setting Presence to '%s'" % status)
+ _moduleLogger.info("Setting Presence to '%s'" % status)
def _get_statuses(self):