From d57352dc03113a6d162cc58c3ef7e131bd8f9f7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Sat, 27 Apr 2019 20:42:35 +0100 Subject: ChatTab: Remove None checks on `ChatTab.jid` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- poezio/tabs/basetabs.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'poezio/tabs') diff --git a/poezio/tabs/basetabs.py b/poezio/tabs/basetabs.py index 860c1c6a..472e782e 100644 --- a/poezio/tabs/basetabs.py +++ b/poezio/tabs/basetabs.py @@ -551,9 +551,7 @@ class ChatTab(Tab): raise NotImplementedError def load_logs(self, log_nb: int) -> Optional[List[Dict[str, Any]]]: - if self.jid is not None: - return logger.get_logs(self.jid.bare, log_nb) - return None + return logger.get_logs(self.jid.bare, log_nb) def log_message(self, txt: str, @@ -563,10 +561,9 @@ class ChatTab(Tab): """ Log the messages in the archives. """ - if self.jid is not None: - name = self.jid.bare - if not logger.log_message(name, nickname, txt, date=time, typ=typ): - self.core.information('Unable to write in the log file', 'Error') + name = self.jid.bare + if not logger.log_message(name, nickname, txt, date=time, typ=typ): + self.core.information('Unable to write in the log file', 'Error') def add_message(self, txt, -- cgit v1.2.3