summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2011-11-27 17:46:20 +0100
committermathieui <mathieui@mathieui.net>2011-11-27 17:46:20 +0100
commita257681b9f64362f667bfa9f2cf9e6f70b6b4319 (patch)
tree141d13cde0315bdab96719b78e7b3230debf7d66
parent24b9931b8b5e03259a2167da02f64fb277a9a6d4 (diff)
downloadpoezio-a257681b9f64362f667bfa9f2cf9e6f70b6b4319.tar.gz
poezio-a257681b9f64362f667bfa9f2cf9e6f70b6b4319.tar.bz2
poezio-a257681b9f64362f667bfa9f2cf9e6f70b6b4319.tar.xz
poezio-a257681b9f64362f667bfa9f2cf9e6f70b6b4319.zip
Add a Bookmark.local() method for local bookmarks
-rw-r--r--src/bookmark.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/bookmark.py b/src/bookmark.py
index 20ea05a7..d1f85307 100644
--- a/src/bookmark.py
+++ b/src/bookmark.py
@@ -57,6 +57,14 @@ class Bookmark(object):
el.append(p)
return el
+ def local(self):
+ """Generate a str for local storage"""
+ local = self.jid
+ if self.nick:
+ local += '/%s' % self.nick
+ local += ':'
+ return local
+
def parse_from_element(el, method=None):
"""
Generate a Bookmark object from a <conference/> element
@@ -132,11 +140,7 @@ def save_remote(xmpp, core=None):
def save_local():
all = ''
for bookmark in filter(lambda b: b.method == "local", bookmarks):
- st = bookmark.jid
- if bookmark.nick:
- st += '/' + bookmark.nick
- st += ':'
- all += st
+ all += bookmark.local()
config.set_and_save('rooms', all)
def save(xmpp, core=None):