--- a/activity.py 2025-01-08 15:51:53.682651896 +0100 +++ b/activity.py 2025-01-08 21:12:21.244338980 +0100 @@ -359,6 +359,7 @@ dbus.Interface( text_proxy, TelepathyGLib.IFACE_CHANNEL_INTERFACE_GROUP) self.text_channel = TextChannelWrapper(text_channel, conn) + self.text_channel.set_one_to_one() self.text_channel.set_received_callback(self._received_cb) self.text_channel.handle_pending_messages() self.text_channel.set_closed_callback( @@ -721,7 +722,7 @@ class TextChannelWrapper(object): - '''Wrap a telepathy Text Channfel to make usage simpler.''' + '''Wrap a telepathy Text Channel to make usage simpler.''' def __init__(self, text_chan, conn): '''Connect to the text channel''' @@ -729,6 +730,7 @@ self._activity_close_cb = None self._text_chan = text_chan self._conn = conn + self._is_one_to_one_xmpp_chat = False self._logger = logging.getLogger( 'chat-activity.TextChannelWrapper') self._signal_matches = [] @@ -766,6 +768,9 @@ if self._activity_close_cb is not None: self._activity_close_cb() + def set_one_to_one(self): + self._is_one_to_one_xmpp_chat = True + def set_received_callback(self, callback): '''Connect the function callback to the signal. @@ -800,9 +805,7 @@ text = text.replace(SLASH, '/') if self._activity_cb: - try: - self._text_chan[TelepathyGLib.IFACE_CHANNEL_INTERFACE_GROUP] - except Exception: + if self._is_one_to_one_xmpp_chat: # One to one XMPP chat co = TelepathyGLib.IFACE_CONNECTION_INTERFACE_ALIASING nick = self._conn[co].RequestAliases([sender])[0]