diff options
author | mathieui <mathieui@mathieui.net> | 2014-04-27 16:32:03 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2014-04-27 16:32:03 +0200 |
commit | 5999b71c416f02dc11803bf52a406b9109ddc3c1 (patch) | |
tree | e132ffeb929d23b94ee4ed2261be5bc8498815c1 /src/core/handlers.py | |
parent | 60224bb76a08d5332e1d0bca810cf9682d45aa89 (diff) | |
download | poezio-5999b71c416f02dc11803bf52a406b9109ddc3c1.tar.gz poezio-5999b71c416f02dc11803bf52a406b9109ddc3c1.tar.bz2 poezio-5999b71c416f02dc11803bf52a406b9109ddc3c1.tar.xz poezio-5999b71c416f02dc11803bf52a406b9109ddc3c1.zip |
Fix #2106 (implement message delivery receipts)
- two options request/ack_message_receipts
- two new theme parameters : CHAR_ACK_RECEIVED and COLOR_CHAR_ACK
- if a message has a receipt, the character is displayed between the
timestamp and the nick, using the color
Diffstat (limited to 'src/core/handlers.py')
-rw-r--r-- | src/core/handlers.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/core/handlers.py b/src/core/handlers.py index 7ce14c65..58217e8f 100644 --- a/src/core/handlers.py +++ b/src/core/handlers.py @@ -59,6 +59,8 @@ def on_carbon_received(self, message): else: return recv['to'] = self.xmpp.boundjid.full + if recv['receipt']: + return self.on_receipt(recv) self.on_normal_message(recv) def on_carbon_sent(self, message): @@ -955,6 +957,22 @@ def on_groupchat_subject(self, message): if self.get_tab_by_name(room_from, tabs.MucTab) is self.current_tab(): self.refresh_window() +def on_receipt(self, message): + """ + When a delivery receipt is received (XEP-0184) + """ + jid = message['from'] + msg_id = message['receipt'] + if not msg_id: + return + + conversation = self.get_tab_by_name(jid) + conversation = conversation or self.get_tab_by_name(jid.bare) + if not conversation: + return + + conversation.ack_message(msg_id) + def on_data_form(self, message): """ When a data form is received |