try:
# HACK Older python-telepathy way
telepathy.server.ChannelTypeStreamedMedia.__init__(self, connection, None)
+ self._requested = props[telepathy.interfaces.CHANNEL_INTERFACE + '.Requested']
+ self._implement_property_get(
+ telepathy.interfaces.CHANNEL_INTERFACE,
+ {"Requested": lambda: self._requested}
+ )
except TypeError:
# HACK Newer python-telepathy way
telepathy.server.ChannelTypeStreamedMedia.__init__(self, connection, manager, props)
def initial_video(self):
return False
+ def get_props(self):
+ # HACK Older python-telepathy doesn't provide this
+ _immutable_properties = {
+ 'ChannelType': telepathy.server.interfaces.CHANNEL_INTERFACE,
+ 'TargetHandle': telepathy.server.interfaces.CHANNEL_INTERFACE,
+ 'Interfaces': telepathy.server.interfaces.CHANNEL_INTERFACE,
+ 'TargetHandleType': telepathy.server.interfaces.CHANNEL_INTERFACE,
+ 'TargetID': telepathy.server.interfaces.CHANNEL_INTERFACE,
+ 'Requested': telepathy.server.interfaces.CHANNEL_INTERFACE
+ }
+ props = dict()
+ for prop, iface in _immutable_properties.items():
+ props[iface + '.' + prop] = \
+ self._prop_getters[iface][prop]()
+ return props
+
@gtk_toolbox.log_exception(_moduleLogger)
def Close(self):
self.close()
try:
# HACK Older python-telepathy way
telepathy.server.ChannelTypeContactList.__init__(self, connection, h)
+ self._requested = props[telepathy.interfaces.CHANNEL_INTERFACE + '.Requested']
+ self._implement_property_get(
+ telepathy.interfaces.CHANNEL_INTERFACE,
+ {"Requested": lambda: self._requested}
+ )
except TypeError:
# HACK Newer python-telepathy way
telepathy.server.ChannelTypeContactList.__init__(self, connection, manager, props)
contacts = addressbook.get_contacts()
self._process_refresh(addressbook, contacts, [])
+ def get_props(self):
+ # HACK Older python-telepathy doesn't provide this
+ _immutable_properties = {
+ 'ChannelType': telepathy.server.interfaces.CHANNEL_INTERFACE,
+ 'TargetHandle': telepathy.server.interfaces.CHANNEL_INTERFACE,
+ 'Interfaces': telepathy.server.interfaces.CHANNEL_INTERFACE,
+ 'TargetHandleType': telepathy.server.interfaces.CHANNEL_INTERFACE,
+ 'TargetID': telepathy.server.interfaces.CHANNEL_INTERFACE,
+ 'Requested': telepathy.server.interfaces.CHANNEL_INTERFACE
+ }
+ props = dict()
+ for prop, iface in _immutable_properties.items():
+ props[iface + '.' + prop] = \
+ self._prop_getters[iface][prop]()
+ return props
+
@gtk_toolbox.log_exception(_moduleLogger)
def Close(self):
self.close()
try:
# HACK Older python-telepathy way
telepathy.server.ChannelTypeText.__init__(self, connection, contactHandle)
+ self._requested = props[telepathy.interfaces.CHANNEL_INTERFACE + '.Requested']
+ self._implement_property_get(
+ telepathy.interfaces.CHANNEL_INTERFACE,
+ {"Requested": lambda: self._requested}
+ )
except TypeError:
# HACK Newer python-telepathy way
telepathy.server.ChannelTypeText.__init__(self, connection, manager, props)
self.__otherHandle = contactHandle
+ def get_props(self):
+ # HACK Older python-telepathy doesn't provide this
+ _immutable_properties = {
+ 'ChannelType': telepathy.server.interfaces.CHANNEL_INTERFACE,
+ 'TargetHandle': telepathy.server.interfaces.CHANNEL_INTERFACE,
+ 'Interfaces': telepathy.server.interfaces.CHANNEL_INTERFACE,
+ 'TargetHandleType': telepathy.server.interfaces.CHANNEL_INTERFACE,
+ 'TargetID': telepathy.server.interfaces.CHANNEL_INTERFACE,
+ 'Requested': telepathy.server.interfaces.CHANNEL_INTERFACE
+ }
+ props = dict()
+ for prop, iface in _immutable_properties.items():
+ props[iface + '.' + prop] = \
+ self._prop_getters[iface][prop]()
+ return props
+
@gtk_toolbox.log_exception(_moduleLogger)
def Send(self, messageType, text):
if messageType != telepathy.CHANNEL_TEXT_MESSAGE_TYPE_NORMAL:
import telepathy
-import util.go_utils as gobject_utils
import util.coroutines as coroutines
import gtk_toolbox
try:
# HACK Older python-telepathy way
telepathy.server.ChannelTypeText.__init__(self, connection, contactHandle)
+ self._requested = props[telepathy.interfaces.CHANNEL_INTERFACE + '.Requested']
+ self._implement_property_get(
+ telepathy.interfaces.CHANNEL_INTERFACE,
+ {"Requested": lambda: self._requested}
+ )
except TypeError:
# HACK Newer python-telepathy way
telepathy.server.ChannelTypeText.__init__(self, connection, manager, props)
else:
self._report_conversation(mergedConversations)
+ def get_props(self):
+ # HACK Older python-telepathy doesn't provide this
+ _immutable_properties = {
+ 'ChannelType': telepathy.server.interfaces.CHANNEL_INTERFACE,
+ 'TargetHandle': telepathy.server.interfaces.CHANNEL_INTERFACE,
+ 'Interfaces': telepathy.server.interfaces.CHANNEL_INTERFACE,
+ 'TargetHandleType': telepathy.server.interfaces.CHANNEL_INTERFACE,
+ 'TargetID': telepathy.server.interfaces.CHANNEL_INTERFACE,
+ 'Requested': telepathy.server.interfaces.CHANNEL_INTERFACE
+ }
+ props = dict()
+ for prop, iface in _immutable_properties.items():
+ props[iface + '.' + prop] = \
+ self._prop_getters[iface][prop]()
+ return props
+
@gtk_toolbox.log_exception(_moduleLogger)
def Send(self, messageType, text):
if messageType != telepathy.CHANNEL_TEXT_MESSAGE_TYPE_NORMAL:
self._conn.add_channels([chan], signal=signal)
elif hasattr(self._conn, "add_channel"):
# HACK Older python-telepathy
+ self._conn.NewChannels([(chan._object_path, chan.get_props())])
self._conn.add_channel(chan, handle, suppress_handler)
else:
raise RuntimeError("Uhh, what just happened with the connection")