diff options
author | Maxime “pep” Buquet <pep@bouah.net> | 2019-04-27 20:42:35 +0100 |
---|---|---|
committer | Maxime “pep” Buquet <pep@bouah.net> | 2019-04-27 20:42:58 +0100 |
commit | d57352dc03113a6d162cc58c3ef7e131bd8f9f7b (patch) | |
tree | 73308183037b7b4e2f65d7a82e9911a6cb3c8fa6 | |
parent | a7826b7b330ea3f3747b2a92fc48456592e77a5b (diff) | |
download | poezio-d57352dc03113a6d162cc58c3ef7e131bd8f9f7b.tar.gz poezio-d57352dc03113a6d162cc58c3ef7e131bd8f9f7b.tar.bz2 poezio-d57352dc03113a6d162cc58c3ef7e131bd8f9f7b.tar.xz poezio-d57352dc03113a6d162cc58c3ef7e131bd8f9f7b.zip |
ChatTab: Remove None checks on `ChatTab.jid`
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
-rw-r--r-- | poezio/tabs/basetabs.py | 11 |
1 files changed, 4 insertions, 7 deletions
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, |