diff options
author | mathieui <mathieui@mathieui.net> | 2021-04-11 13:31:20 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2021-04-11 16:33:53 +0200 |
commit | 4ae1b714c47440419c56f2fdce288bd6350348e2 (patch) | |
tree | 9aac0660dd52976ffa49a70696cc684fb89018ab /poezio/tabs/basetabs.py | |
parent | 6f36d6b507044bdf8376ae1159ab0c86a3cd337a (diff) | |
download | poezio-4ae1b714c47440419c56f2fdce288bd6350348e2.tar.gz poezio-4ae1b714c47440419c56f2fdce288bd6350348e2.tar.bz2 poezio-4ae1b714c47440419c56f2fdce288bd6350348e2.tar.xz poezio-4ae1b714c47440419c56f2fdce288bd6350348e2.zip |
internal: make mam_sync and use_log use tab-specific options
Diffstat (limited to 'poezio/tabs/basetabs.py')
-rw-r--r-- | poezio/tabs/basetabs.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/poezio/tabs/basetabs.py b/poezio/tabs/basetabs.py index d7dac0e0..34b2efdc 100644 --- a/poezio/tabs/basetabs.py +++ b/poezio/tabs/basetabs.py @@ -45,7 +45,7 @@ from poezio.core.structs import Command, Completion, Status from poezio.config import config from poezio.decorators import command_args_parser, refresh_wrapper from poezio.logger import logger -from poezio.log_loader import MAMFiller +from poezio.log_loader import MAMFiller, LogLoader from poezio.text_buffer import TextBuffer from poezio.theming import get_theme, dump_tuple from poezio.user import User @@ -1008,6 +1008,16 @@ class OneToOneTab(ChatTab): shortdesc='Request the attention.', desc='Attention: Request the attention of the contact. Can also ' 'send a message along with the attention.') + self.init_logs() + + def init_logs(self) -> None: + use_log = config.get_by_tabname('use_log', self.jid) + mam_sync = config.get_by_tabname('mam_sync', self.jid) + if use_log and mam_sync: + self.mam_filler = MAMFiller(logger, self) + asyncio.ensure_future( + LogLoader(logger, self, use_log).tab_open() + ) def remote_user_color(self): return dump_tuple(get_theme().COLOR_REMOTE_USER) |