summaryrefslogtreecommitdiff
path: root/sleekxmpp/xmlstream
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2010-08-30 17:12:10 -0400
committerLance Stout <lancestout@gmail.com>2010-08-30 17:12:10 -0400
commit3749c1b88c4774b85fcee1e26e8bce8dbeef23c7 (patch)
tree8a5e889ce11102ca9466bf2375c69a04914f6b9f /sleekxmpp/xmlstream
parent998741b87e7babc6e0af9bcf79f10f4422ba96f1 (diff)
downloadslixmpp-3749c1b88c4774b85fcee1e26e8bce8dbeef23c7.tar.gz
slixmpp-3749c1b88c4774b85fcee1e26e8bce8dbeef23c7.tar.bz2
slixmpp-3749c1b88c4774b85fcee1e26e8bce8dbeef23c7.tar.xz
slixmpp-3749c1b88c4774b85fcee1e26e8bce8dbeef23c7.zip
Fixed ElementBase.match to match using sub_interface elements.
Diffstat (limited to 'sleekxmpp/xmlstream')
-rw-r--r--sleekxmpp/xmlstream/stanzabase.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/sleekxmpp/xmlstream/stanzabase.py b/sleekxmpp/xmlstream/stanzabase.py
index 7eb3f978..86b528d1 100644
--- a/sleekxmpp/xmlstream/stanzabase.py
+++ b/sleekxmpp/xmlstream/stanzabase.py
@@ -614,6 +614,12 @@ class ElementBase(object):
if self[name] != value:
return False
+ # Check sub interfaces.
+ if len(xpath) > 1:
+ next_tag = xpath[1]
+ if next_tag in self.sub_interfaces and self[next_tag]:
+ return True
+
# Attempt to continue matching the XPath using the stanza's plugins.
if not matched_substanzas and len(xpath) > 1:
# Convert {namespace}tag@attribs to just tag