summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2021-04-16 18:51:01 +0200
committermathieui <mathieui@mathieui.net>2021-04-16 18:51:01 +0200
commit3591221e04a539d5eaea8252c363c78515adc171 (patch)
treed89c259697288cc9ae7c095692021f733c3c6513
parentf9e0994311e6810050df2ff7ba7b9f982a662065 (diff)
downloadpoezio-3591221e04a539d5eaea8252c363c78515adc171.tar.gz
poezio-3591221e04a539d5eaea8252c363c78515adc171.tar.bz2
poezio-3591221e04a539d5eaea8252c363c78515adc171.tar.xz
poezio-3591221e04a539d5eaea8252c363c78515adc171.zip
fix: split inactive chatstates from message in one to one tabs
-rw-r--r--poezio/tabs/conversationtab.py6
-rw-r--r--poezio/tabs/privatetab.py6
2 files changed, 8 insertions, 4 deletions
diff --git a/poezio/tabs/conversationtab.py b/poezio/tabs/conversationtab.py
index b8acfd8b..78faf49a 100644
--- a/poezio/tabs/conversationtab.py
+++ b/poezio/tabs/conversationtab.py
@@ -131,8 +131,10 @@ class ConversationTab(OneToOneTab):
msg['html']['body'] = xhtml.poezio_colors_to_html(msg['body'])
msg['body'] = xhtml.clean_text(msg['body'])
if config.get_by_tabname('send_chat_states', self.general_jid):
- needed = 'inactive' if self.inactive else 'active'
- msg['chat_state'] = needed
+ if self.inactive:
+ self.send_chat_state('inactive', always_send=True)
+ else:
+ msg['chat_state'] = 'active'
if attention:
msg['attention'] = True
self.core.events.trigger('conversation_say_after', msg, self)
diff --git a/poezio/tabs/privatetab.py b/poezio/tabs/privatetab.py
index 6a79b055..daf81733 100644
--- a/poezio/tabs/privatetab.py
+++ b/poezio/tabs/privatetab.py
@@ -167,8 +167,10 @@ class PrivateTab(OneToOneTab):
msg['html']['body'] = xhtml.poezio_colors_to_html(msg['body'])
msg['body'] = xhtml.clean_text(msg['body'])
if config.get_by_tabname('send_chat_states', self.general_jid):
- needed = 'inactive' if self.inactive else 'active'
- msg['chat_state'] = needed
+ if self.inactive:
+ self.send_chat_state('inactive', always_send=True)
+ else:
+ msg['chat_state'] = 'active'
if attention:
msg['attention'] = True
self.core.events.trigger('private_say_after', msg, self)