From 1fcc2ec83c4bde4fdf1789ebceee70632972fd16 Mon Sep 17 00:00:00 2001 From: mathieui Date: Tue, 6 Sep 2011 20:59:11 +0200 Subject: =?UTF-8?q?Fixed=20various=20things=20regarding=20privatetabs:=20t?= =?UTF-8?q?he=20room=20nick=20is=20used=20when=20it=20is=20not=20defined?= =?UTF-8?q?=20in=20the=20config=20file=20(was=20appearing=20as=20a=20messa?= =?UTF-8?q?ge=20from=20the=20room=20itself)=20connections/deconnections=20?= =?UTF-8?q?are=20now=20monitored=20(=E2=86=92=C2=A0Fixes=20#2233,=20and=20?= =?UTF-8?q?thus=20fixes=20#2211)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/core.py') diff --git a/src/core.py b/src/core.py index acd77e13..6deb3643 100644 --- a/src/core.py +++ b/src/core.py @@ -458,6 +458,7 @@ class Core(object): tab = self.get_tab_by_name('%s/%s' % (room_name, old_nick), tabs.PrivateTab) if tab: tab.rename_user(old_nick, new_nick) + self.on_user_rejoined_private_conversation(room_name, new_nick) def on_user_left_private_conversation(self, room_name, nick, status_message): """ @@ -467,6 +468,30 @@ class Core(object): if tab: tab.user_left(status_message, nick) + def on_user_rejoined_private_conversation(self, room_name, nick): + """ + The user joined a MUC: add a message in the associated private conversation + """ + tab = self.get_tab_by_name('%s/%s' % (room_name, nick), tabs.PrivateTab) + if tab: + tab.user_rejoined(nick) + + def disable_private_tabs(self, room_name): + """ + Disable private tabs when leaving a room + """ + for tab in self.tabs: + if tab.get_name().startswith(room_name) and isinstance(tab, tabs.PrivateTab): + tab.deactivate() + + def enable_private_tabs(self,room_name): + """ + Enable private tabs when joining a room + """ + for tab in self.tabs: + if tab.get_name().startswith(room_name) and isinstance(tab, tabs.PrivateTab): + tab.activate() + def on_user_changed_status_in_private(self, jid, msg): tab = self.get_tab_by_name(jid) if tab: # display the message in private @@ -1265,6 +1290,7 @@ class Core(object): else: r.own_nick = nick r.users = [] + self.enable_private_tabs(room) def command_bookmark(self, arg): """ -- cgit v1.2.3