Commit 7c74cac2 authored by Philipp Hörist's avatar Philipp Hörist

MUC: Add method for canceling captcha challenges

parent b7d1e581
......@@ -26,6 +26,7 @@ from nbxmpp.protocol import NS_MUC_ADMIN
from nbxmpp.protocol import NS_MUC_OWNER
from nbxmpp.protocol import NS_CAPTCHA
from nbxmpp.protocol import NS_ADDRESS
from nbxmpp.protocol import ERR_NOT_ACCEPTABLE
from nbxmpp.protocol import JID
from nbxmpp.protocol import Iq
from nbxmpp.protocol import Message
......@@ -495,6 +496,12 @@ class MUC:
captcha.addChild(node=form_node)
return iq
def cancel_captcha(self, room_jid, message_id):
message = Message(typ='error', to=room_jid)
message.setID(message_id)
message.setError(ERR_NOT_ACCEPTABLE)
self._client.send(message)
@callback
def _default_response(self, stanza):
if not isResultNode(stanza):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment