From edd33a126d16fb27402488d2fd5324352f4b2d46 Mon Sep 17 00:00:00 2001 From: Goffi Date: Sat, 1 Aug 2020 15:59:49 +0200 Subject: [PATCH] core (xmpp): text can now be specified in `sendError` --- sat/core/xmpp.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sat/core/xmpp.py b/sat/core/xmpp.py index 5e615fef..cf3630f3 100644 --- a/sat/core/xmpp.py +++ b/sat/core/xmpp.py @@ -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