diff --git a/sleekxmpp/xmlstream/stanzabase.py b/sleekxmpp/xmlstream/stanzabase.py index d4c1118..8bdcb0b 100644 --- a/sleekxmpp/xmlstream/stanzabase.py +++ b/sleekxmpp/xmlstream/stanzabase.py @@ -71,6 +71,12 @@ class ElementBase(object): self.xml.remove(aff.xml) return aff + def get(self, key, defaultvalue=None): + value = self[key] + if value is None or value == '': + return defaultvalue + return value + def keys(self): out = [] out += [x for x in self.interfaces]