From bacbd835eb799f33e3d449bd7803458db6a99d51 Mon Sep 17 00:00:00 2001 From: mathieui Date: Fri, 13 Oct 2017 01:18:22 +0200 Subject: Fix more pylint errors --- poezio/tabs/basetabs.py | 15 +++++++++++++-- poezio/tabs/muctab.py | 4 ++++ 2 files changed, 17 insertions(+), 2 deletions(-) (limited to 'poezio/tabs') diff --git a/poezio/tabs/basetabs.py b/poezio/tabs/basetabs.py index 98f4c977..3a898129 100644 --- a/poezio/tabs/basetabs.py +++ b/poezio/tabs/basetabs.py @@ -431,17 +431,20 @@ class ChatTab(Tab): """ plugin_commands = {} plugin_keys = {} + message_type = 'chat' def __init__(self, core, jid=''): Tab.__init__(self, core) self.name = jid self.text_win = None + self.remote_wants_chatstates = False + self.directed_presence = None self._text_buffer = TextBuffer() self.chatstate = None # can be "active", "composing", "paused", "gone", "inactive" # We keep a reference of the event that will set our chatstate to "paused", so that # we can delete it or change it if we need to self.timed_event_paused = None # Keeps the last sent message to complete it easily in completion_correct, and to replace it. - self.last_sent_message = None + self.last_sent_message = {} self.key_func['M-v'] = self.move_separator self.key_func['M-h'] = self.scroll_separator self.key_func['M-/'] = self.last_words_completion @@ -474,6 +477,10 @@ class ChatTab(Tab): def is_muc(self): return False + @property + def general_jid(self): + return NotImplementedError + def load_logs(self, log_nb): logs = logger.get_logs(safeJID(self.name).bare, log_nb) return logs @@ -573,11 +580,15 @@ class ChatTab(Tab): self._text_buffer.messages = [] self.text_win.rebuild_everything(self._text_buffer) + def check_send_chat_state(self): + "If we should send a chat state" + return True + def send_chat_state(self, state, always_send=False): """ Send an empty chatstate message """ - if not self.is_muc or self.joined: + if self.check_send_chat_state(): if state in ('active', 'inactive', 'gone') and self.inactive and not always_send: return if (config.get_by_tabname('send_chat_states', self.general_jid) diff --git a/poezio/tabs/muctab.py b/poezio/tabs/muctab.py index 2942ba77..ce43dd0e 100644 --- a/poezio/tabs/muctab.py +++ b/poezio/tabs/muctab.py @@ -208,6 +208,10 @@ class MucTab(ChatTab): def is_muc(self): return True + def check_send_chat_state(self): + "If we should send a chat state" + return self.joined + @property def last_connection(self): last_message = self._text_buffer.last_message -- cgit v1.2.3