Fix tab.name not being a string by calling the right property

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2019-04-08 11:38:29 +01:00
parent 0551867bfd
commit 6ab49c188a
Signed by: pep
GPG key ID: DEDA74AEECA9D0F2
5 changed files with 6 additions and 6 deletions

View file

@ -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

View file

@ -106,7 +106,7 @@ def replace_random_user(message, tab):
else:
# that doesnt 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):

View file

@ -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):

View file

@ -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)

View file

@ -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: