Mercurial > libervia-backend
comparison sat/core/xmpp.py @ 3522:41a6c144dc90
core (xmpp): added `appCondition` argument to `sendError`
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 05 May 2021 12:58:11 +0200 |
parents | 7550ae9cfbac |
children | 4b33ed5abd8f |
comparison
equal
deleted
inserted
replaced
3521:62f490eff51c | 3522:41a6c144dc90 |
---|---|
531 """ | 531 """ |
532 iq_elt = xmlstream.IQ(self.xmlstream, type_) | 532 iq_elt = xmlstream.IQ(self.xmlstream, type_) |
533 iq_elt.timeout = timeout | 533 iq_elt.timeout = timeout |
534 return iq_elt | 534 return iq_elt |
535 | 535 |
536 def sendError(self, iq_elt, condition, text=None): | 536 def sendError(self, iq_elt, condition, text=None, appCondition=None): |
537 """Send error stanza build from iq_elt | 537 """Send error stanza build from iq_elt |
538 | 538 |
539 @param iq_elt(domish.Element): initial IQ element | 539 @param iq_elt(domish.Element): initial IQ element |
540 @param condition(unicode): error condition | 540 @param condition(unicode): error condition |
541 """ | 541 """ |
542 iq_error_elt = error.StanzaError(condition, text=text).toResponse(iq_elt) | 542 iq_error_elt = error.StanzaError( |
543 condition, text=text, appContidtion=appCondition | |
544 ).toResponse(iq_elt) | |
543 self.xmlstream.send(iq_error_elt) | 545 self.xmlstream.send(iq_error_elt) |
544 | 546 |
545 def generateMessageXML(self, data, post_xml_treatments=None): | 547 def generateMessageXML(self, data, post_xml_treatments=None): |
546 """Generate <message/> stanza from message data | 548 """Generate <message/> stanza from message data |
547 | 549 |