summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2013-05-10 14:55:50 +0200
committermathieui <mathieui@mathieui.net>2013-05-10 14:55:50 +0200
commit686352d22bc2973cdb9a003353a9811e5587d177 (patch)
treed204694e3331c69809f755a247dcc8b6e2f35646
parent6767d04a1d89a3666403172079f1b69ec9eb121c (diff)
downloadpoezio-686352d22bc2973cdb9a003353a9811e5587d177.tar.gz
poezio-686352d22bc2973cdb9a003353a9811e5587d177.tar.bz2
poezio-686352d22bc2973cdb9a003353a9811e5587d177.tar.xz
poezio-686352d22bc2973cdb9a003353a9811e5587d177.zip
Do not add a nick to each bookmarked room
-rw-r--r--src/bookmark.py3
-rw-r--r--src/core.py8
2 files changed, 4 insertions, 7 deletions
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: