summaryrefslogtreecommitdiff
path: root/sleekxmpp/plugins/xep_0030/stanza
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2013-02-22 10:07:19 -0800
committerLance Stout <lancestout@gmail.com>2013-02-22 10:07:19 -0800
commit766e0b685d7d13adbcaa6e475c03b3ba96c196b2 (patch)
tree7ecc60b205b36f686c1f81f05b29c6cacc3a9800 /sleekxmpp/plugins/xep_0030/stanza
parent8c763fcf43b2690c4f02a9f577fc2d6d72917ee2 (diff)
downloadslixmpp-766e0b685d7d13adbcaa6e475c03b3ba96c196b2.tar.gz
slixmpp-766e0b685d7d13adbcaa6e475c03b3ba96c196b2.tar.bz2
slixmpp-766e0b685d7d13adbcaa6e475c03b3ba96c196b2.tar.xz
slixmpp-766e0b685d7d13adbcaa6e475c03b3ba96c196b2.zip
Clear out iterable data when resetting Disco items.
Diffstat (limited to 'sleekxmpp/plugins/xep_0030/stanza')
-rw-r--r--sleekxmpp/plugins/xep_0030/stanza/items.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/sleekxmpp/plugins/xep_0030/stanza/items.py b/sleekxmpp/plugins/xep_0030/stanza/items.py
index 512f2336..10458614 100644
--- a/sleekxmpp/plugins/xep_0030/stanza/items.py
+++ b/sleekxmpp/plugins/xep_0030/stanza/items.py
@@ -128,9 +128,10 @@ class DiscoItems(ElementBase):
def del_items(self):
"""Remove all items."""
self._items = set()
- for item in self['substanzas']:
- if isinstance(item, DiscoItem):
- self.xml.remove(item.xml)
+ items = [i for i in self.iterables if isinstance(i, DiscoItem)]
+ for item in items:
+ self.xml.remove(item.xml)
+ self.iterables.remove(item)
class DiscoItem(ElementBase):