[Git][gajim/gajim][master] DBus: Correctly raise NewMessage signal

Philipp Hörist gitlab at dev.gajim.org
Thu Jan 10 21:37:03 CET 2019


Philipp Hörist pushed to branch master at gajim / gajim


Commits:
b84054b5 by Philipp Hörist at 2019-01-10T20:34:17Z
DBus: Correctly raise NewMessage signal

- - - - -


2 changed files:

- gajim/remote_control.py
- gajim/session.py


Changes:

=====================================
gajim/remote_control.py
=====================================
@@ -312,6 +312,8 @@ class GajimRemote(Server):
             ged.POSTGUI, self.on_unsubscribed_presence_received)
         app.ged.register_event_handler('gc-message-received',
             ged.POSTGUI, self.on_gc_message_received)
+        app.ged.register_event_handler('decrypted-message-received',
+            ged.POSTGUI, self._nec_decrypted_message_received)
         app.ged.register_event_handler('our-show', ged.POSTGUI,
             self.on_our_status)
         app.ged.register_event_handler('account-created', ged.POSTGUI,
@@ -387,6 +389,12 @@ class GajimRemote(Server):
             obj.timestamp, obj.delayed, obj.xhtml_msgtxt,
             obj.displaymarking, obj.needs_highlight]))
 
+    def _nec_decrypted_message_received(self, obj):
+        self.raise_signal('NewMessage', (
+            obj.conn.name, [obj.fjid, obj.msgtxt, obj.timestamp,
+            obj.encrypted, obj.mtype, obj.subject,
+            obj.msg_log_id, obj.user_nick, obj.xhtml, obj.form_node]))
+
     def on_our_status(self, obj):
         self.raise_signal('AccountPresence', (obj.show, obj.conn.name))
 


=====================================
gajim/session.py
=====================================
@@ -168,12 +168,6 @@ class ChatControlSession:
         if not pm:
             self.roster_message2(obj)
 
-        if app.interface.remote_ctrl:
-            app.interface.remote_ctrl.raise_signal('NewMessage', (
-                self.conn.name, [obj.fjid, obj.msgtxt, obj.timestamp,
-                obj.encrypted, obj.mtype, obj.subject,
-                obj.msg_log_id, obj.user_nick, obj.xhtml, obj.form_node]))
-
     def roster_message2(self, obj):
         """
         Display the message or show notification in the roster



View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/b84054b58cf940061d494c75496e45d7f0b5ec78

-- 
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/b84054b58cf940061d494c75496e45d7f0b5ec78
You're receiving this email because of your account on dev.gajim.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gajim.org/pipermail/commits/attachments/20190110/213cc95b/attachment-0001.html>


More information about the Commits mailing list