fix: split inactive chatstates from message in one to one tabs

This commit is contained in:
mathieui 2021-04-16 18:51:01 +02:00
parent f9e0994311
commit 3591221e04
2 changed files with 8 additions and 4 deletions

View file

@ -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)

View file

@ -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)