self._props = props
try:
- # Older python-telepathy way
+ # HACK Older python-telepathy way
telepathy.server.ChannelTypeStreamedMedia.__init__(self, connection, None)
except TypeError:
- # Newer python-telepathy way
+ # HACK Newer python-telepathy way
telepathy.server.ChannelTypeStreamedMedia.__init__(self, connection, manager, props)
telepathy.server.ChannelInterfaceCallState.__init__(self)
telepathy.server.ChannelInterfaceGroup.__init__(self)
def close(self):
telepathy.server.ChannelTypeStreamedMedia.Close(self)
if self._manager.channel_exists(self._props):
- # Older python-telepathy requires doing this manually
+ # HACK Older python-telepathy requires doing this manually
self._manager.remove_channel(self)
self.remove_from_connection()
self._props = props
try:
- # Older python-telepathy way
+ # HACK Older python-telepathy way
telepathy.server.ChannelTypeContactList.__init__(self, connection, h)
except TypeError:
- # Newer python-telepathy way
+ # HACK Newer python-telepathy way
telepathy.server.ChannelTypeContactList.__init__(self, connection, manager, props)
telepathy.server.ChannelInterfaceGroup.__init__(self)
telepathy.server.ChannelTypeContactList.Close(self)
if self._manager.channel_exists(self._props):
- # Older python-telepathy requires doing this manually
+ # HACK Older python-telepathy requires doing this manually
self._manager.remove_channel(self)
self.remove_from_connection()
self._props = props
try:
- # Older python-telepathy way
+ # HACK Older python-telepathy way
telepathy.server.ChannelTypeText.__init__(self, connection, contactHandle)
except TypeError:
- # Newer python-telepathy way
+ # HACK Newer python-telepathy way
telepathy.server.ChannelTypeText.__init__(self, connection, manager, props)
self._nextRecievedId = 0
self._lastMessageTimestamp = datetime.datetime(1, 1, 1)
telepathy.server.ChannelTypeText.Close(self)
if self._manager.channel_exists(self._props):
- # Older python-telepathy requires doing this manually
+ # HACK Older python-telepathy requires doing this manually
self._manager.remove_channel(self)
self.remove_from_connection()
chan = self._requestable_channel_classes[type](props, **args)
if hasattr(self._conn, "add_channels"):
- # Newer python-telepathy
+ # HACK Newer python-telepathy
self._conn.add_channels([chan], signal=signal)
elif hasattr(self._conn, "add_channel"):
- # Older python-telepathy
+ # HACK Older python-telepathy
self._conn.add_channel(chan, handle, suppress_handler)
else:
raise RuntimeError("Uhh, what just happened with the connection")
h = self.handle(handleType, handleId) if handleId != 0 else None
props = self._generate_props(type, h, suppressHandler)
if hasattr(self, "_validate_handle"):
- # On newer python-telepathy
+ # HACK Newer python-telepathy
self._validate_handle(props)
chan = self._channelManager.channel_for_props(props, signal=True)