Philipp Hörist pushed to branch master at gajim / python-nbxmpp


Commits:
3d571262 by Philipp Hörist at 2019-06-22T21:33:50Z
Add jid to CommonError results

- - - - -


2 changed files:

- nbxmpp/structs.py
- nbxmpp/util.py


Changes:

=====================================
nbxmpp/structs.py
=====================================
@@ -135,7 +135,7 @@ class OMEMOBundle(namedtuple('OMEMOBundle', 'spk 
spk_signature ik otpks')):
         return random.SystemRandom().choice(self.otpks)
 
 
-class CommonError(namedtuple('CommonError', 'type message')):
+class CommonError(namedtuple('CommonError', 'type message jid')):
     def __str__(self):
         if self.message is not None:
             return '%s: %s' % (self.type, self.message)


=====================================
nbxmpp/util.py
=====================================
@@ -214,7 +214,8 @@ def raise_error(log_method, stanza, type_=None, 
message=None):
     if type_ is None:
         type_ = stanza.getError()
         message = stanza.getErrorMsg()
-    error = CommonError(type_, message)
+    jid = stanza.getFrom()
+    error = CommonError(type_, message, jid)
     log_method(error)
     if log_method.__name__ in ('warning', 'error'):
         log_method(stanza)



View it on GitLab: 
https://dev.gajim.org/gajim/python-nbxmpp/commit/3d57126268db971d05629ae1bc82f9cec588698c

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/python-nbxmpp/commit/3d57126268db971d05629ae1bc82f9cec588698c
You're receiving this email because of your account on dev.gajim.org.

_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to