changeset 7055609c61dc in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=7055609c61dc description: add ability for chatstate to fo from inactive to pause when we re-select a tab where we already typed something. Fixes #4380
diffstat:
src/chat_control.py | 23 ++++++++++++----------- 1 files changed, 12 insertions(+), 11 deletions(-)
diffs (48 lines):
diff -r e8d168bf800e -r 7055609c61dc src/chat_control.py --- a/src/chat_control.py Wed May 18 22:48:28 2011 +0200 +++ b/src/chat_control.py Thu Jan 06 14:53:34 2011 +0100 @@ -2139,8 +2139,8 @@ if self.kbd_activity_in_last_5_secs and message_buffer.get_char_count(): # Only composing if the keyboard activity was in text entry self.send_chatstate('composing') - elif self.mouse_over_in_last_5_secs and\ - jid == self.parent_win.get_active_jid(): + elif self.mouse_over_in_last_5_secs and current_state == 'inactive' and\ + jid == self.parent_win.get_active_jid(): self.send_chatstate('active') else: if current_state == 'composing': @@ -2436,15 +2436,8 @@ self.reset_kbd_mouse_timeout_vars() return
- # prevent going paused if we we were not composing (JEP violation) - if state == 'paused' and not contact.our_chatstate == 'composing': - # go active before - MessageControl.send_message(self, None, chatstate = 'active') - contact.our_chatstate = 'active' - self.reset_kbd_mouse_timeout_vars() - # if we're inactive prevent composing (JEP violation) - elif contact.our_chatstate == 'inactive' and state == 'composing': + if contact.our_chatstate == 'inactive' and state == 'composing': # go active before MessageControl.send_message(self, None, chatstate = 'active') contact.our_chatstate = 'active' @@ -2538,7 +2531,15 @@ # send chatstate inactive to the one we're leaving # and active to the one we visit if state: - self.send_chatstate('active', self.contact) + message_buffer = self.msg_textview.get_buffer() + if message_buffer.get_char_count(): + self.send_chatstate('paused', self.contact) + else: + self.send_chatstate('active', self.contact) + self.reset_kbd_mouse_timeout_vars() + gobject.source_remove(self.possible_paused_timeout_id) + gobject.source_remove(self.possible_inactive_timeout_id) + self._schedule_activity_timers() else: self.send_chatstate('inactive', self.contact) # Hide bigger avatar window