summaryrefslogtreecommitdiff
path: root/sleekxmpp/roster/multi.py
diff options
context:
space:
mode:
Diffstat (limited to 'sleekxmpp/roster/multi.py')
-rw-r--r--sleekxmpp/roster/multi.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/sleekxmpp/roster/multi.py b/sleekxmpp/roster/multi.py
index 28876814..84577a9d 100644
--- a/sleekxmpp/roster/multi.py
+++ b/sleekxmpp/roster/multi.py
@@ -9,7 +9,6 @@
from sleekxmpp.xmlstream import JID
from sleekxmpp.roster import RosterNode
-
class Roster(object):
"""
@@ -104,10 +103,13 @@ class Roster(object):
db -- The new datastore interface.
"""
self.db = db
- for node in self.db.entries(None, {}):
- self.add(node)
- for node in self._rosters:
+ existing_entries = set(self._rosters)
+ new_entries = set(self.db.entries(None, {}))
+
+ for node in existing_entries:
self._rosters[node].set_backend(db)
+ for node in new_entries - existing_entries:
+ self.add(node)
def reset(self):
"""