diff options
author | mathieui <mathieui@mathieui.net> | 2011-09-06 20:59:11 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2011-09-06 20:59:11 +0200 |
commit | 1fcc2ec83c4bde4fdf1789ebceee70632972fd16 (patch) | |
tree | f408c131186c44948b3b94a8b9631398a9d12ae7 /src/core.py | |
parent | 6c3b43bb1c3bcbd257f96d1f26940be9b7b2220e (diff) | |
download | poezio-1fcc2ec83c4bde4fdf1789ebceee70632972fd16.tar.gz poezio-1fcc2ec83c4bde4fdf1789ebceee70632972fd16.tar.bz2 poezio-1fcc2ec83c4bde4fdf1789ebceee70632972fd16.tar.xz poezio-1fcc2ec83c4bde4fdf1789ebceee70632972fd16.zip |
Fixed various things regarding privatetabs:
the room nick is used when it is not defined in the config file (was appearing as a message from the room itself)
connections/deconnections are now monitored (→ Fixes #2233, and thus fixes #2211)
Diffstat (limited to 'src/core.py')
-rw-r--r-- | src/core.py | 26 |
1 files changed, 26 insertions, 0 deletions
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): """ |