summaryrefslogtreecommitdiff
path: root/src/core.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/core.py')
-rw-r--r--src/core.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/core.py b/src/core.py
index 96531e5f..3cdc7592 100644
--- a/src/core.py
+++ b/src/core.py
@@ -1325,6 +1325,18 @@ class Core(object):
r.users = []
self.enable_private_tabs(room)
+ def get_bookmark_nickname(self, room_name):
+ """
+ Returns the nickname associated with a bookmark
+ or the default nickname
+ """
+ bookmarks = config.get('rooms', '').split(':')
+ jid = JID(room_name)
+ for bookmark in bookmarks:
+ if JID(bookmark).bare == jid.bare:
+ return JID(bookmark).resource
+ return self.own_nick
+
def command_bookmark(self, arg):
"""
/bookmark [room][/nick]