diff options
Diffstat (limited to 'extensions/captcha_forms.py')
-rw-r--r-- | extensions/captcha_forms.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/extensions/captcha_forms.py b/extensions/captcha_forms.py index 690a10e..b701dec 100644 --- a/extensions/captcha_forms.py +++ b/extensions/captcha_forms.py @@ -9,14 +9,14 @@ Implements XEP-0158: CAPTCHA Forms """ -def sendCaptcha(user, url): - logger.debug("VK: sending message with captcha to %s", user.source) +def sendCaptcha(vk, url): + logger.debug("VK: sending message with captcha to %s", vk.source) body = _("WARNING: VK has sent you a CAPTCHA." " Please, follow the link: %s and enter the text shown on the image to the chat." " Example: !captcha my_captcha_key." "\nWarning: don't use Firefox to open the link.") % url - msg = xmpp.Message(user.source, body, "chat", frm=TransportID) - msg.setID(user.vk.engine.captcha["sid"]) + msg = xmpp.Message(vk.source, body, "chat", frm=TransportID) + msg.setID(vk.engine.captcha["sid"]) x = msg.setTag("x", namespace=xmpp.NS_OOB) x.setTagData("url", url) captcha = msg.setTag("captcha", namespace=xmpp.NS_CAPTCHA) @@ -42,7 +42,7 @@ def sendCaptcha(user, url): oob = msg.setTag("data", {"cid": "sha1+%s@bob.xmpp.org" % hash, "type": "image/jpg", "max-age": "0"}, xmpp.NS_URN_OOB) oob.setData(encoded) sender(Component, msg) - sendPresence(user.source, TransportID, show="xa", reason=body, hash=USER_CAPS_HASH) + sendPresence(vk.source, TransportID, show="xa", reason=body, hash=USER_CAPS_HASH) TransportFeatures.update({xmpp.NS_OOB, xmpp.NS_MEDIA, |