diff --git a/src/common/connection_handlers.py b/src/common/connection_handlers.py index dfe91f01d..81bb2a7e1 100644 --- a/src/common/connection_handlers.py +++ b/src/common/connection_handlers.py @@ -1121,11 +1121,11 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco) def build_http_auth_answer(self, iq_obj, answer): if answer == 'yes': - iq = iq_obj.buildReply('result') + self.connection.send(iq_obj.buildReply('result')) elif answer == 'no': - iq = iq_obj.buildReply('error') - iq.setError('not-authorized', 401) - self.connection.send(iq) + from common.xmpp.protocol import ERR_NOT_AUTHORIZED + err = common.xmpp.Error(iq_obj, ERR_NOT_AUTHORIZED) + self.connection.send(err) def _HttpAuthCB(self, con, iq_obj): gajim.log.debug('HttpAuthCB') diff --git a/src/common/xmpp/protocol.py b/src/common/xmpp/protocol.py index b9d2ad9ff..fee4cdb0c 100644 --- a/src/common/xmpp/protocol.py +++ b/src/common/xmpp/protocol.py @@ -357,10 +357,10 @@ class Protocol(Node): if tag.getName()=='text': return tag.getData() return self.getError() def getErrorCode(self): - """ Return the error code. Obsolette. """ + """ Return the error code. Obsolete. """ return self.getTagAttr('error','code') def setError(self,error,code=None): - """ Set the error code. Obsolette. Use error-conditions instead. """ + """ Set the error code. Obsolete. Use error-conditions instead. """ if code: if str(code) in _errorcodes.keys(): error=ErrorNode(_errorcodes[str(code)],text=error) else: error=ErrorNode(ERR_UNDEFINED_CONDITION,code=code,typ='cancel',text=error)