From 423a7d14472412b9dd9156c4c40102149858bc69 Mon Sep 17 00:00:00 2001 From: mathieui Date: Sat, 14 May 2011 15:45:30 +0200 Subject: Fixes #2177, and fixes chatstates a bit --- src/core.py | 2 -- src/tabs.py | 11 +++++------ 2 files changed, 5 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/core.py b/src/core.py index ce95e310..8e0d56ce 100644 --- a/src/core.py +++ b/src/core.py @@ -951,8 +951,6 @@ class Core(object): room_from = message.getMucroom() if message['type'] == 'error': # Check if it's an error return self.room_error(message, from_room) - if nick_from == room_from: - nick_from = None room = self.get_room_by_name(room_from) tab = self.get_tab_by_name(room_from, tabs.MucTab) if tab and tab.get_room() and tab.get_room().get_user_by_name(nick_from) and\ diff --git a/src/tabs.py b/src/tabs.py index 0301538c..4a7e26f5 100644 --- a/src/tabs.py +++ b/src/tabs.py @@ -306,10 +306,10 @@ 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 not empty_before and empty_after: + if empty_after: self.send_chat_state("active") self.cancel_paused_delay() - elif (empty_before or (self.timed_event_paused is not None and not self.timed_event_paused())): + elif empty_before or (self.timed_event_paused is not None and not self.timed_event_paused()): self.cancel_paused_delay() self.send_chat_state("composing") self.set_paused_delay(True) @@ -734,10 +734,6 @@ class MucTab(ChatTab): if self.complete_commands(self.input): return - empty_before = self.input.get_text() == '' or (self.input.get_text().startswith('/') and not self.input.get_text().startswith('//')) - empty_after = self.input.get_text() == '' or (self.input.get_text().startswith('/') and not self.input.get_text().startswith('//')) - self.send_composing_chat_state(empty_before, empty_after) - # If we are not completing a command or a command's argument, complete a nick compare_users = lambda x: x.last_talked word_list = [user.nick for user in sorted(self._room.users, key=compare_users, reverse=True)\ @@ -749,7 +745,10 @@ class MucTab(ChatTab): else: add_after = ' ' + empty_before = self.input.get_text() == '' or (self.input.get_text().startswith('/') and not self.input.get_text().startswith('//')) self.input.auto_completion(word_list, add_after) + empty_after = self.input.get_text() == '' or (self.input.get_text().startswith('/') and not self.input.get_text().startswith('//')) + self.send_composing_chat_state(empty_before, empty_after) def get_color_state(self): return self._room.color_state -- cgit v1.2.3