diff options
author | mathieui <mathieui@mathieui.net> | 2011-06-18 11:17:20 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2011-06-18 11:17:20 +0200 |
commit | da5623094d443f0bc1991414a4eafbaaf8964830 (patch) | |
tree | 387180dcb7c67386401a536181faa8e25ad2fade /src | |
parent | 7d82a4fb19f8c180073c4313b2c5a9c8ec31b253 (diff) | |
download | poezio-da5623094d443f0bc1991414a4eafbaaf8964830.tar.gz poezio-da5623094d443f0bc1991414a4eafbaaf8964830.tar.bz2 poezio-da5623094d443f0bc1991414a4eafbaaf8964830.tar.xz poezio-da5623094d443f0bc1991414a4eafbaaf8964830.zip |
hopefully fix chat states
Diffstat (limited to 'src')
-rw-r--r-- | src/tabs.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/tabs.py b/src/tabs.py index 4ea3c280..7f6c91ff 100644 --- a/src/tabs.py +++ b/src/tabs.py @@ -269,6 +269,7 @@ class ChatTab(Tab): self.commands['say'] = (self.command_say, _("""Usage: /say <message>\nSay: Just send the message. Useful if you want your message to begin with a '/'"""), None) + self.chat_state = None def last_words_completion(self): """ @@ -308,6 +309,7 @@ class ChatTab(Tab): msg = self.core.xmpp.make_message(self.get_name()) msg['type'] = self.message_type msg['chat_state'] = state + self.chat_state = state msg.send() def send_composing_chat_state(self, empty_before, empty_after): @@ -316,8 +318,13 @@ class ChatTab(Tab): on the the current status of the input """ if config.get('send_chat_states', 'true') == 'true' and self.remote_wants_chatstates: - if empty_after: + if self.chat_state == "composing" and not empty_after: + self.cancel_paused_delay() + self.set_paused_delay(True) + elif empty_after and not self.chat_state == 'active': + self.cancel_paused_delay() self.send_chat_state("active") + elif empty_after: self.cancel_paused_delay() elif empty_before or (self.timed_event_paused is not None and not self.timed_event_paused()): self.cancel_paused_delay() |