diff options
Diffstat (limited to 'sleekxmpp/plugins')
-rw-r--r-- | sleekxmpp/plugins/xep_0030/stanza/items.py | 7 |
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): |