core (xmpp): text can now be specified in sendError

This commit is contained in:
Goffi 2020-08-01 15:59:49 +02:00
commit edd33a126d

View file

@ -532,13 +532,13 @@ class SatXMPPEntity:
iq_elt.timeout = timeout
return iq_elt
def sendError(self, iq_elt, condition):
def sendError(self, iq_elt, condition, text=None):
"""Send error stanza build from iq_elt
@param iq_elt(domish.Element): initial IQ element
@param condition(unicode): error condition
"""
iq_error_elt = error.StanzaError(condition).toResponse(iq_elt)
iq_error_elt = error.StanzaError(condition, text=text).toResponse(iq_elt)
self.xmlstream.send(iq_error_elt)
def generateMessageXML(self, data, post_xml_treatments=None):
@ -1466,8 +1466,8 @@ class SatRosterProtocol(xmppim.RosterClientProtocol):
del self._groups[group]
except KeyError:
log.warning(
"there is no cache for the group [{group}] of the removed roster "
"item [{jid_}]".format(group=group, jid=entity)
f"there is no cache for the group [{group}] of the removed roster "
f"item [{entity}]"
)
# then we send the bridge signal