示例#1
0
        private void doGetVerify(String reason, AbstractActionFuture future)
        {
            QQAccount   account = (QQAccount)(getContext().getAccount());
            LoginModule login   = (LoginModule)getContext().getModule(AbstractModule.Type.LOGIN);

            login.getCaptcha(account.getUin(), delegate(QQActionEvent evt) {
                if (evt.getType() == QQActionEvent.Type.EVT_OK)
                {
                    QQNotifyEventArgs.ImageVerify verify = new QQNotifyEventArgs.ImageVerify();

                    verify.type   = QQNotifyEventArgs.ImageVerify.VerifyType.LOGIN;
                    verify.image  = (BitmapImage)evt.getTarget();
                    verify.reason = reason;
                    verify.future = future;

                    getContext().fireNotify(new QQNotifyEvent(QQNotifyEvent.Type.CAPACHA_VERIFY, verify));
                }
                else if (evt.getType() == QQActionEvent.Type.EVT_ERROR)
                {
                    future.notifyActionEvent(
                        QQActionEvent.Type.EVT_ERROR,
                        (QQException)evt.getTarget());
                }
            });
        }
示例#2
0
        /**
         * {@inheritDoc}
         *
         * 刷新验证码
         */

        public AbstractActionFuture freshVerify(QQNotifyEvent verifyEvent, QQActionListener.OnActionEvent listener)
        {
            LoginModule mod = (LoginModule)getModule(AbstractModule.Type.LOGIN);

            return(mod.getCaptcha(account.getUin(), listener));
        }
示例#3
0
        /**
         * <p>getCaptcha.</p>
         *
         * @param listener a {@link iqq.im.QQActionListener.OnActionEvent} object.
         */
        public void getCaptcha(QQActionListener.OnActionEvent listener)
        {
            LoginModule loginModule = (LoginModule)getModule(AbstractModule.Type.LOGIN);

            loginModule.getCaptcha(getAccount().getUin(), listener);
        }