From 6ab49c188a6e5bb95773165f0bdbd672b41c8c81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Mon, 8 Apr 2019 11:38:29 +0100 Subject: Fix tab.name not being a string by calling the right property MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- plugins/irc.py | 2 +- plugins/replace.py | 2 +- plugins/server_part.py | 2 +- poezio/core/commands.py | 2 +- poezio/core/core.py | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/irc.py b/plugins/irc.py index eeef128c..7f8e8d35 100644 --- a/plugins/irc.py +++ b/plugins/irc.py @@ -199,7 +199,7 @@ class Plugin(BasePlugin): already_opened = False for tab in self.core.tabs: - if tab.name.endswith(room_suffix) and tab.joined: + if tab.name.full.endswith(room_suffix) and tab.joined: already_opened = True break diff --git a/plugins/replace.py b/plugins/replace.py index 7e259dab..8ec91f70 100644 --- a/plugins/replace.py +++ b/plugins/replace.py @@ -106,7 +106,7 @@ def replace_random_user(message, tab): else: # that doesn’t make any sense. By why use this pattern in a # ConversationTab anyway? - return str(tab.name) + return tab.name.full def replace_dice(message, tab): diff --git a/plugins/server_part.py b/plugins/server_part.py index 7a71d94b..9b863a2b 100644 --- a/plugins/server_part.py +++ b/plugins/server_part.py @@ -53,7 +53,7 @@ class Plugin(BasePlugin): message = args[1] for tab in self.core.get_tabs(MucTab): - if tab.name.endswith(jid): + if tab.name.full.endswith(jid): tab.command_part(message) def completion_server_part(self, the_input): diff --git a/poezio/core/commands.py b/poezio/core/commands.py index 242b60a3..5b990091 100644 --- a/poezio/core/commands.py +++ b/poezio/core/commands.py @@ -335,7 +335,7 @@ class CommandCore: if room.find('@') == -1 and not server_root: tab = self.core.tabs.current_tab if isinstance(tab, tabs.MucTab): - if tab.name.find('@') != -1: + if tab.name.full.find('@') != -1: domain = safeJID(tab.name).domain room += '@%s' % domain return (room, set_nick) diff --git a/poezio/core/core.py b/poezio/core/core.py index 2e0e0acb..5e3e912b 100644 --- a/poezio/core/core.py +++ b/poezio/core/core.py @@ -1277,7 +1277,7 @@ class Core: if reason is None: reason = '\x195}You left the room\x193}' for tab in self.get_tabs(tabs.PrivateTab): - if tab.name.startswith(room_name): + if tab.name.full.startswith(room_name): tab.deactivate(reason=reason) def enable_private_tabs(self, room_name: str, @@ -1288,7 +1288,7 @@ class Core: if reason is None: reason = '\x195}You joined the room\x193}' for tab in self.get_tabs(tabs.PrivateTab): - if tab.name.startswith(room_name): + if tab.name.full.startswith(room_name): tab.activate(reason=reason) def on_user_changed_status_in_private(self, jid: JID, status: str) -> None: -- cgit v1.2.3