DBus: Correctly raise NewMessage signal

This commit is contained in:
Philipp Hörist 2019-01-10 21:34:17 +01:00
parent 60f8c52c3a
commit 3841ed513a
2 changed files with 8 additions and 6 deletions

View File

@ -312,6 +312,8 @@ class GajimRemote(Server):
ged.POSTGUI, self.on_unsubscribed_presence_received) ged.POSTGUI, self.on_unsubscribed_presence_received)
app.ged.register_event_handler('gc-message-received', app.ged.register_event_handler('gc-message-received',
ged.POSTGUI, self.on_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, app.ged.register_event_handler('our-show', ged.POSTGUI,
self.on_our_status) self.on_our_status)
app.ged.register_event_handler('account-created', ged.POSTGUI, app.ged.register_event_handler('account-created', ged.POSTGUI,
@ -388,6 +390,12 @@ class GajimRemote(Server):
obj.timestamp, obj.delayed, obj.xhtml_msgtxt, obj.status_code, obj.timestamp, obj.delayed, obj.xhtml_msgtxt, obj.status_code,
obj.displaymarking, obj.captcha_form, obj.needs_highlight])) obj.displaymarking, obj.captcha_form, 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): def on_our_status(self, obj):
self.raise_signal('AccountPresence', (obj.show, obj.conn.name)) self.raise_signal('AccountPresence', (obj.show, obj.conn.name))

View File

@ -166,12 +166,6 @@ class ChatControlSession:
if not pm: if not pm:
self.roster_message2(obj) 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): def roster_message2(self, obj):
""" """
Display the message or show notification in the roster Display the message or show notification in the roster