summaryrefslogtreecommitdiff
path: root/sleekxmpp/roster/single.py
diff options
context:
space:
mode:
Diffstat (limited to 'sleekxmpp/roster/single.py')
-rw-r--r--sleekxmpp/roster/single.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/sleekxmpp/roster/single.py b/sleekxmpp/roster/single.py
index 611f8944..159eb07d 100644
--- a/sleekxmpp/roster/single.py
+++ b/sleekxmpp/roster/single.py
@@ -101,19 +101,21 @@ class RosterNode(object):
"""Iterate over the roster items."""
return self._jids.__iter__()
- def set_backend(self, db=None):
+ def set_backend(self, db=None, save=True):
"""
Set the datastore interface object for the roster node.
Arguments:
db -- The new datastore interface.
+ save -- If True, save the existing state to the new
+ backend datastore. Defaults to True.
"""
self.db = db
existing_entries = set(self._jids)
new_entries = set(self.db.entries(self.jid, {}))
for jid in existing_entries:
- self._jids[jid].set_backend(db)
+ self._jids[jid].set_backend(db, save)
for jid in new_entries - existing_entries:
self.add(jid)