summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2012-09-24 21:00:23 -0700
committerLance Stout <lancestout@gmail.com>2012-09-24 21:00:23 -0700
commita4abdf9fa6bf3aa8f1394fb5aa57632211a4705d (patch)
tree76bc61b139c8be88ba7e33f6ff56a78960eb75dd
parent6c57bb055346384760129c25ad5402913982eaac (diff)
downloadslixmpp-a4abdf9fa6bf3aa8f1394fb5aa57632211a4705d.tar.gz
slixmpp-a4abdf9fa6bf3aa8f1394fb5aa57632211a4705d.tar.bz2
slixmpp-a4abdf9fa6bf3aa8f1394fb5aa57632211a4705d.tar.xz
slixmpp-a4abdf9fa6bf3aa8f1394fb5aa57632211a4705d.zip
Fix deleting non-existent stanza plugins.
-rw-r--r--sleekxmpp/xmlstream/stanzabase.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/sleekxmpp/xmlstream/stanzabase.py b/sleekxmpp/xmlstream/stanzabase.py
index 233e91f6..a75d7079 100644
--- a/sleekxmpp/xmlstream/stanzabase.py
+++ b/sleekxmpp/xmlstream/stanzabase.py
@@ -488,7 +488,7 @@ class ElementBase(object):
"""
return self.init_plugin(attrib, lang)
- def _get_plugin(self, name, lang=None):
+ def _get_plugin(self, name, lang=None, check=False):
if lang is None:
lang = self.get_lang()
@@ -501,12 +501,12 @@ class ElementBase(object):
if (name, None) in self.plugins:
return self.plugins[(name, None)]
else:
- return self.init_plugin(name, lang)
+ return None if check else self.init_plugin(name, lang)
else:
if (name, lang) in self.plugins:
return self.plugins[(name, lang)]
else:
- return self.init_plugin(name, lang)
+ return None if check else self.init_plugin(name, lang)
def init_plugin(self, attrib, lang=None, existing_xml=None, reuse=True):
"""Enable and initialize a stanza plugin.
@@ -862,7 +862,7 @@ class ElementBase(object):
else:
self._del_attr(attrib)
elif attrib in self.plugin_attrib_map:
- plugin = self._get_plugin(attrib, lang)
+ plugin = self._get_plugin(attrib, lang, check=True)
if not plugin:
return self
if plugin.is_extension: