diff options
author | Maxime “pep” Buquet <pep@bouah.net> | 2019-04-08 14:33:19 +0100 |
---|---|---|
committer | Maxime “pep” Buquet <pep@bouah.net> | 2019-04-08 14:33:19 +0100 |
commit | 8d53ff71d1abc7170365d90117436c508cb60b29 (patch) | |
tree | 1c0359e9877c3c15ec90e650519781ccbdbd88f8 | |
parent | 4a3d1c76e3da6cca7ff378291d351428ddff4074 (diff) | |
download | poezio-8d53ff71d1abc7170365d90117436c508cb60b29.tar.gz poezio-8d53ff71d1abc7170365d90117436c508cb60b29.tar.bz2 poezio-8d53ff71d1abc7170365d90117436c508cb60b29.tar.xz poezio-8d53ff71d1abc7170365d90117436c508cb60b29.zip |
ChatTab: utilise self.jid
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
-rw-r--r-- | poezio/tabs/basetabs.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/poezio/tabs/basetabs.py b/poezio/tabs/basetabs.py index 048a8187..3bf3dd29 100644 --- a/poezio/tabs/basetabs.py +++ b/poezio/tabs/basetabs.py @@ -550,8 +550,9 @@ class ChatTab(Tab): raise NotImplementedError def load_logs(self, log_nb: int) -> Optional[List[Dict[str, Any]]]: - logs = logger.get_logs(self.jid.bare, log_nb) - return logs + if self.jid is not None: + return logger.get_logs(self.jid.bare, log_nb) + return None def log_message(self, txt: str, @@ -561,9 +562,10 @@ class ChatTab(Tab): """ Log the messages in the archives. """ - name = safeJID(self.name).bare - if not logger.log_message(name, nickname, txt, date=time, typ=typ): - self.core.information('Unable to write in the log file', 'Error') + 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') def add_message(self, txt, |