From d5ef6383049e6a1177dab5f852399047fa42f12f Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Tue, 13 Sep 2011 10:18:54 +0200 Subject: [PATCH] create a session or use existing one when sending a message through dbus. Fixes #6973 --- src/remote_control.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/remote_control.py b/src/remote_control.py index 584a4790d..30a0b26c2 100644 --- a/src/remote_control.py +++ b/src/remote_control.py @@ -432,7 +432,13 @@ class SignalObject(dbus.service.Object): connected_account, contact = self._get_account_and_contact(account, jid) if connected_account: connection = gajim.connections[connected_account] - connection.send_message(jid, message, keyID, type_, subject) + sessions = connection.get_sessions(jid) + if sessions: + session = sessions[0] + else: + session = connection.make_new_session(jid) + connection.send_message(jid, message, keyID, type_, subject, + session=session) return DBUS_BOOLEAN(True) return DBUS_BOOLEAN(False)