changeset c02744737254 in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=c02744737254 description: Fix showing messages sent via dbus. Fixes #6976
diffstat:
src/chat_control.py | 33 --------------------------------- src/remote_control.py | 5 +++++ 2 files changed, 5 insertions(+), 33 deletions(-)
diffs (72 lines):
diff -r 10ea2c9b999c -r c02744737254 src/chat_control.py --- a/src/chat_control.py Tue Sep 13 10:18:54 2011 +0200 +++ b/src/chat_control.py Thu Sep 15 21:51:51 2011 +0200 @@ -1426,18 +1426,6 @@ ChatControlBase.__init__(self, self.TYPE_ID, parent_win, 'chat_control', contact, acct, resource)
- self._dbus_message_sent_match = None - if dbus_support.supported: - bus = dbus_support.session_bus.bus() - try: - obj = bus.get_object(remote_control.SERVICE, remote_control.OBJ_PATH) - except: - # likely dbus service not started - pass - else: - iface = dbus.Interface(obj, remote_control.INTERFACE) - self._dbus_message_sent_match = iface.connect_to_signal("MessageSent", self.on_message_sent) - self.gpg_is_active = False # for muc use: # widget = self.xml.get_object('muc_window_actions_button') @@ -2280,23 +2268,6 @@ callback_args=[contact, message, encrypted, xhtml, self.get_seclabel()], process_commands=process_commands)
- - def on_message_sent(self, account_and_message): - # this is called when an external application sends a chat - # message using DBus. So we likely need to update the UI - # accordingly. - message = account_and_message[1][1] - jid_and_resource = account_and_message[1][0] - if not message: - return - - # try to filter based on jid/resource to avoid duplicate - # messages. - if jid_and_resource.find('/') > -1: - jid = jid_and_resource.split('/')[0] - if jid == self.contact.jid: - self.print_conversation(message, frm='outgoing') - def check_for_possible_paused_chatstate(self, arg): """ Did we move mouse of that window or write something in message textview @@ -2650,10 +2621,6 @@ # instance object gajim.plugin_manager.remove_gui_extension_point('chat_control', self)
- # disconnect from the dbus MessageSent signal. - if self._dbus_message_sent_match: - self._dbus_message_sent_match.remove() - gajim.ged.remove_event_handler('pep-received', ged.GUI1, self._nec_pep_received) gajim.ged.remove_event_handler('vcard-received', ged.GUI1, diff -r 10ea2c9b999c -r c02744737254 src/remote_control.py --- a/src/remote_control.py Tue Sep 13 10:18:54 2011 +0200 +++ b/src/remote_control.py Thu Sep 15 21:51:51 2011 +0200 @@ -438,6 +438,11 @@ session = sessions[0] else: session = connection.make_new_session(jid) + ctrl = gajim.interface.msg_win_mgr.search_control(jid, + connected_account) + if ctrl: + ctrl.print_conversation(message, frm='outgoing') + connection.send_message(jid, message, keyID, type_, subject, session=session) return DBUS_BOOLEAN(True)