diff options
author | John Smith <mrdoctorwho@gmail.com> | 2016-12-25 10:39:45 +0300 |
---|---|---|
committer | John Smith <mrdoctorwho@gmail.com> | 2016-12-25 10:39:45 +0300 |
commit | aa401e046fb785aa145645223f04d9213bb3ac3c (patch) | |
tree | d0bb5b39d306532f7339fdc6f074f33a4049e81c /extensions/captcha_forms.py | |
parent | 102ee9137df8d50127525e2195d9d6dcc57f481b (diff) |
Fix AttributeError in captcha_forms #148
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, |