diff options
author | Philipp Hörist <philipp@hoerist.com> | 2023-06-20 21:06:17 +0300 |
---|---|---|
committer | Philipp Hörist <philipp@hoerist.com> | 2023-06-20 21:08:51 +0300 |
commit | 3d000af416021a22d962ec40f2ac6a0e9b6d8835 (patch) | |
tree | d312c1354dc10f1c72dbe22f703917f666661499 | |
parent | 624ab71cf3cd46e2e43f22e64f2546c95a913a0b (diff) |
imprv: CommonError: Add 'by' attribute
-rw-r--r-- | nbxmpp/structs.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/nbxmpp/structs.py b/nbxmpp/structs.py index 5f77de2..a673932 100644 --- a/nbxmpp/structs.py +++ b/nbxmpp/structs.py @@ -773,10 +773,18 @@ class CommonError: self.condition_data = self._error_node.getTagData(self.condition) self.app_condition = stanza.getAppError() self.type = stanza.getErrorType() + self.by = None self.jid = stanza.getFrom() self.id = stanza.getID() self._text = {} + by = self._error_node.getAttr('by') + if by is not None: + try: + self.by = JID.from_string(by) + except Exception: + pass + text_elements = self._error_node.getTags('text', namespace=Namespace.STANZAS) for element in text_elements: lang = element.getXmlLang() |