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/core.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/core.py')
-rw-r--r-- | src/core/core.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/core/core.py b/src/core/core.py index 4bb0725b..95adc067 100644 --- a/src/core/core.py +++ b/src/core/core.py @@ -208,6 +208,7 @@ class Core(object): self.xmpp.add_event_handler("groupchat_subject", self.on_groupchat_subject) self.xmpp.add_event_handler("message", self.on_message) + self.xmpp.add_event_handler("receipt_received", self.on_receipt) self.xmpp.add_event_handler("got_online", self.on_got_online) self.xmpp.add_event_handler("got_offline", self.on_got_offline) self.xmpp.add_event_handler("roster_update", self.on_roster_update) @@ -277,6 +278,10 @@ class Core(object): self.configuration_change_handlers = {"": []} self.add_configuration_handler("create_gaps", self.on_gaps_config_change) + self.add_configuration_handler("request_message_receipts", + self.on_request_receipts_config_change) + self.add_configuration_handler("ack_message_receipts", + self.on_ack_receipts_config_change) self.add_configuration_handler("plugins_dir", self.on_plugins_dir_config_change) self.add_configuration_handler("plugins_conf_dir", @@ -331,6 +336,18 @@ class Core(object): if value.lower() == "false": self.tabs = list(tab for tab in self.tabs if tab) + def on_request_receipts_config_change(self, option, value): + """ + Called when the request_message_receipts option changes + """ + self.xmpp.plugin['xep_0184'].auto_request = config.get(option, True) + + def on_ack_receipts_config_change(self, option, value): + """ + Called when the ack_message_receipts option changes + """ + self.xmpp.plugin['xep_0184'].auto_ack = config.get(option, True) + def on_plugins_dir_config_change(self, option, value): """ Called when the plugins_dir option is changed @@ -1850,6 +1867,7 @@ class Core(object): on_status_codes = handlers.on_status_codes on_groupchat_subject = handlers.on_groupchat_subject on_data_form = handlers.on_data_form + on_receipt = handlers.on_receipt on_attention = handlers.on_attention room_error = handlers.room_error outgoing_stanza = handlers.outgoing_stanza |