fix: split inactive chatstates from message in one to one tabs
This commit is contained in:
parent
f9e0994311
commit
3591221e04
2 changed files with 8 additions and 4 deletions
|
@ -131,8 +131,10 @@ class ConversationTab(OneToOneTab):
|
||||||
msg['html']['body'] = xhtml.poezio_colors_to_html(msg['body'])
|
msg['html']['body'] = xhtml.poezio_colors_to_html(msg['body'])
|
||||||
msg['body'] = xhtml.clean_text(msg['body'])
|
msg['body'] = xhtml.clean_text(msg['body'])
|
||||||
if config.get_by_tabname('send_chat_states', self.general_jid):
|
if config.get_by_tabname('send_chat_states', self.general_jid):
|
||||||
needed = 'inactive' if self.inactive else 'active'
|
if self.inactive:
|
||||||
msg['chat_state'] = needed
|
self.send_chat_state('inactive', always_send=True)
|
||||||
|
else:
|
||||||
|
msg['chat_state'] = 'active'
|
||||||
if attention:
|
if attention:
|
||||||
msg['attention'] = True
|
msg['attention'] = True
|
||||||
self.core.events.trigger('conversation_say_after', msg, self)
|
self.core.events.trigger('conversation_say_after', msg, self)
|
||||||
|
|
|
@ -167,8 +167,10 @@ class PrivateTab(OneToOneTab):
|
||||||
msg['html']['body'] = xhtml.poezio_colors_to_html(msg['body'])
|
msg['html']['body'] = xhtml.poezio_colors_to_html(msg['body'])
|
||||||
msg['body'] = xhtml.clean_text(msg['body'])
|
msg['body'] = xhtml.clean_text(msg['body'])
|
||||||
if config.get_by_tabname('send_chat_states', self.general_jid):
|
if config.get_by_tabname('send_chat_states', self.general_jid):
|
||||||
needed = 'inactive' if self.inactive else 'active'
|
if self.inactive:
|
||||||
msg['chat_state'] = needed
|
self.send_chat_state('inactive', always_send=True)
|
||||||
|
else:
|
||||||
|
msg['chat_state'] = 'active'
|
||||||
if attention:
|
if attention:
|
||||||
msg['attention'] = True
|
msg['attention'] = True
|
||||||
self.core.events.trigger('private_say_after', msg, self)
|
self.core.events.trigger('private_say_after', msg, self)
|
||||||
|
|
Loading…
Reference in a new issue