diff options
author | mathieui <mathieui@mathieui.net> | 2020-05-31 23:14:39 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2021-04-02 22:22:30 +0200 |
commit | f56811d5466d4b23f6bfc71b88cb6cdbc4090e29 (patch) | |
tree | 506778c58581b0f37b690fcd4b98fc0e94d3c3c3 /poezio/core/core.py | |
parent | bbc22fc8bc99be8c84272efa591487a33ef12fc4 (diff) | |
download | poezio-f56811d5466d4b23f6bfc71b88cb6cdbc4090e29.tar.gz poezio-f56811d5466d4b23f6bfc71b88cb6cdbc4090e29.tar.bz2 poezio-f56811d5466d4b23f6bfc71b88cb6cdbc4090e29.tar.xz poezio-f56811d5466d4b23f6bfc71b88cb6cdbc4090e29.zip |
logging: Remove the "typ" passing when adding or logging messages
Diffstat (limited to 'poezio/core/core.py')
-rw-r--r-- | poezio/core/core.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/poezio/core/core.py b/poezio/core/core.py index f41eb363..5ea8978f 100644 --- a/poezio/core/core.py +++ b/poezio/core/core.py @@ -71,7 +71,11 @@ from poezio.core.structs import ( POSSIBLE_SHOW, ) -from poezio.ui.types import Message, InfoMessage +from poezio.ui.types import ( + Message, + InfoMessage, + PersistentInfoMessage, +) log = logging.getLogger(__name__) @@ -1328,7 +1332,7 @@ class Core: """ tab = self.tabs.by_name_and_class(jid, tabs.ConversationTab) if tab is not None: - tab.add_message(InfoMessage(msg), typ=2) + tab.add_message(PersistentInfoMessage(msg)) if self.tabs.current_tab is tab: self.refresh_window() @@ -1743,12 +1747,11 @@ class Core: nickname='Error', nick_color=get_theme().COLOR_ERROR_MSG, ), - typ=2, ) code = error['error']['code'] if code == '401': msg = 'To provide a password in order to join the room, type "/join / password" (replace "password" by the real password)' - tab.add_message(InfoMessage(msg), typ=2) + tab.add_message(PersistentInfoMessage(msg)) if code == '409': if config.getstr('alternative_nickname') != '': if not tab.joined: @@ -1757,11 +1760,10 @@ class Core: else: if not tab.joined: tab.add_message( - InfoMessage( + PersistentInfoMessage( 'You can join the room with another nick, ' 'by typing "/join /other_nick"' - ), - typ=2, + ) ) self.refresh_window() |