Daniel Brötzmann pushed to branch mainwindow at gajim / gajim
Commits: 1f3302cf by wurstsalat at 2021-11-02T00:21:12+01:00 Set chatstate when selecting chats
- - - - -
2 changed files:
- gajim/gtk/chat_page.py - gajim/gtk/controls/base.py
Changes:
===================================== gajim/gtk/chat_page.py ===================================== @@ -60,6 +60,7 @@ def __init__(self): self._ui.filter_bar_toggle.connect( 'toggled', self._on_filter_revealer_toggled)
+ self._active_control = None self._chat_list_stack = ChatListStack( self._chat_filter, self._ui.search_entry) self._chat_list_stack.connect('chat-selected', self._on_chat_selected) @@ -130,6 +131,13 @@ def _on_chat_selected(self, _chat_list_stack, workspace_id, account, jid): self._search_view.set_context(account, jid) self.emit('chat-selected', workspace_id, account, jid)
+ control = self.get_control(account, jid) + if self._active_control != control: + if self._active_control is not None: + self._active_control.set_control_active(False) + control.set_control_active(True) + self._active_control = control + def _on_chat_unselected(self, _chat_list_stack): self._chat_stack.clear() self._search_view.set_context(None, None)
===================================== gajim/gtk/controls/base.py ===================================== @@ -1264,16 +1264,7 @@ def clear(tv): def set_control_active(self, state): if state: self.set_emoticon_popover() - jid = self.contact.jid - if self.conversation_view.autoscroll: - # we are at the end - if app.window.get_chat_unread_count( - self.account, self.contact.jid) > 0: - self.redraw_after_event_removed(jid) - app.window.mark_as_read(self.account, self.contact.jid) - - # send chatstate inactive to the one we're leaving - # and active to the one we visit + if self.msg_textview.has_text(): self._client.get_module('Chatstate').set_chatstate( self.contact, Chatstate.PAUSED)
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/1f3302cf8c4f6719148f4d0547cf6cfbc...