From 686352d22bc2973cdb9a003353a9811e5587d177 Mon Sep 17 00:00:00 2001 From: mathieui Date: Fri, 10 May 2013 14:55:50 +0200 Subject: Do not add a nick to each bookmarked room --- src/bookmark.py | 3 --- src/core.py | 8 ++++---- 2 files changed, 4 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/bookmark.py b/src/bookmark.py index 7fc1e9c0..f950154d 100644 --- a/src/bookmark.py +++ b/src/bookmark.py @@ -28,9 +28,6 @@ class Bookmark(object): self.jid = jid self.name = name or jid self.autojoin = autojoin - if not nick: - default = os.environ.get('USER') if os.environ.get('USER') else 'poezio' - nick = config.get('default_nick', '') or default self.nick = nick self.password = password self._method = method diff --git a/src/core.py b/src/core.py index d57605fa..1d946df3 100644 --- a/src/core.py +++ b/src/core.py @@ -146,7 +146,7 @@ class Core(object): self._current_tab_nb = 0 self.previous_tab_nb = 0 - self.own_nick = config.get('default_nick', '') or self.xmpp.boundjid.user + self.own_nick = config.get('default_nick', '') or self.xmpp.boundjid.user or os.environ.get('USER') or 'poezio' self.plugins_autoloaded = False self.plugin_manager = PluginManager(self) @@ -1810,7 +1810,7 @@ class Core(object): if len(args) == 0: tab = self.current_tab() roomname = tab.get_name() - if tab.joined: + if tab.joined and tab.own_nick != self.own_nick: nick = tab.own_nick elif args[0] == '*': for tab in self.tabs: @@ -3267,9 +3267,9 @@ class Core(object): bookmark.get_remote(self.xmpp) for bm in bookmark.bookmarks: tab = self.get_tab_by_name(bm.jid, tabs.MucTab) - if not tab: - self.open_new_room(bm.jid, bm.nick, False) nick = bm.nick if bm.nick else self.own_nick + if not tab: + self.open_new_room(bm.jid, nick, False) self.initial_joins.append(bm.jid) histo_length = config.get('muc_history_length', 20) if histo_length == -1: -- cgit v1.2.3