diff options
author | Yann Leboulanger <asterix@lagaule.org> | 2011-03-25 00:48:56 +0300 |
---|---|---|
committer | Yann Leboulanger <asterix@lagaule.org> | 2011-03-25 00:48:56 +0300 |
commit | 168e87aefd40bf370d0ce9a100943bdfce536ac2 (patch) | |
tree | 7729c791cfe36f674dd3e93e1a249a64cb676c45 /src/remote_control.py | |
parent | eceee142e94018f403059dc3c0b2ccce305e0327 (diff) |
[Phil] add 2 dbus signals: MessageSent and ChatState. Update UI on messagesent. Fixes #6787
Diffstat (limited to 'src/remote_control.py')
-rw-r--r-- | src/remote_control.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/remote_control.py b/src/remote_control.py index 24a36d110..4dfe18f60 100644 --- a/src/remote_control.py +++ b/src/remote_control.py @@ -131,6 +131,23 @@ class Remote: self.on_account_created) gajim.ged.register_event_handler('vcard-received', ged.POSTGUI, self.on_vcard_received) + gajim.ged.register_event_handler('chatstate-received', ged.POSTGUI, + self.on_chatstate_received) + gajim.ged.register_event_handler('message-sent', ged.POSTGUI, + self.on_message_sent) + + def on_chatstate_received(self, obj): + self.raise_signal('ChatState', (obj.conn.name, [ + obj.jid, obj.fjid, obj.stanza, obj.resource, obj.composing_xep, + obj.chatstate])) + + def on_message_sent(self, obj): + try: + chatstate = obj.chatstate + except AttributeError: + chatstate = "" + self.raise_signal('MessageSent', (obj.conn.name, [ + obj.jid, obj.message, obj.keyID, chatstate])) def on_last_status_time(self, obj): self.raise_signal('LastStatusTime', (obj.conn.name, [ @@ -288,6 +305,14 @@ class SignalObject(dbus.service.Object): def NewGmail(self, account_and_array): pass + @dbus.service.signal(INTERFACE, signature='av') + def ChatState(self, account_and_array): + pass + + @dbus.service.signal(INTERFACE, signature='av') + def MessageSent(self, account_and_array): + pass + def raise_signal(self, signal, arg): """ Raise a signal, with a single argument of unspecified type Instead of |