Examples of QQActionListener


Examples of iqq.im.QQActionListener

   * 轮询邮件信息 先通过pt4获取check url 再通过check检查登录验证 再通过login获取key2 再通过wpkey获取key3
   * 然后得到wpkey,进行邮件轮询
   */
  public void doPoll() {
    // 步骤四
    final QQActionListener wpkeyListener = new QQActionListener() {

      @Override
      public void onActionEvent(QQActionEvent event) {
        if (event.getType() == QQActionEvent.Type.EVT_OK) {
          errorCount = 0;
          // 跳到轮询
          loopPoll(event.getTarget().toString(), 0);
        } else if (event.getType() == QQActionEvent.Type.EVT_ERROR) {
          if (errorCount < QQConstants.MAX_POLL_ERR_CNT) {
            getPT4Auth(this);
            errorCount++;
          }
        }
      }
    };
    // 步骤三
    final QQActionListener loginListener = new QQActionListener() {

      @Override
      public void onActionEvent(QQActionEvent event) {
        if (event.getType() == QQActionEvent.Type.EVT_OK) {
          errorCount = 0;
          // 跳到步骤四
          String key = event.getTarget().toString();
          getWPKey(key, wpkeyListener);
          getContext().getSession().setEmailAuthKey(key);
        } else if (event.getType() == QQActionEvent.Type.EVT_ERROR) {
          if (errorCount < QQConstants.MAX_POLL_ERR_CNT) {
            getPT4Auth(this);
            errorCount++;
          }
        }
      }
    };
    // 步骤二
    final QQActionListener checkListener = new QQActionListener() {

      @Override
      public void onActionEvent(QQActionEvent event) {
        if (event.getType() == QQActionEvent.Type.EVT_OK) {
          errorCount = 0;
          // 跳到步骤三
          login(loginListener);
        } else if (event.getType() == QQActionEvent.Type.EVT_ERROR) {
          if (errorCount < QQConstants.MAX_POLL_ERR_CNT) {
            getPT4Auth(this);
            errorCount++;
          }
        }
      }
    };
    // 步骤一
    QQActionListener pt4Listener = new QQActionListener() {

      @Override
      public void onActionEvent(QQActionEvent event) {
        if (event.getType() == QQActionEvent.Type.EVT_OK) {
          errorCount = 0;
View Full Code Here

Examples of iqq.im.QQActionListener

   *            凭证ID,就算没有Cookie都可以轮询
   * @param t
   *            邮件,好像是时间,用来消除轮询返回的列表中邮件,不然一直会返回那个邮件回来
   */
  public void loopPoll(final String sid, long t) {
    QQActionListener listener = new QQActionListener() {

      @Override
      public void onActionEvent(QQActionEvent event) {
        if (event.getType() == QQActionEvent.Type.EVT_OK) {
          errorCount = 0;
View Full Code Here

Examples of iqq.im.QQActionListener

  public QQActionFuture sendMsg(final QQMsg msg, QQActionListener listener) {
    if(msg.getType() == QQMsg.Type.SESSION_MSG) {
      final ProcActionFuture future = new ProcActionFuture(listener, true);
      QQStranger stranger = (QQStranger) msg.getTo();
      if(stranger.getGroupSig() == null || stranger.getGroupSig().equals("")) {
        getSessionMsgSig(stranger, new QQActionListener() {
          @Override
          public void onActionEvent(QQActionEvent event) {
            if(event.getType() == QQActionEvent.Type.EVT_OK) {
              if(!future.isCanceled()){
                doSendMsg(msg, future);
              }
            }else if(event.getType() == QQActionEvent.Type.EVT_ERROR){
              future.notifyActionEvent(event.getType(), event.getTarget());
            }
          }
        });
      }
      return future;
    } else if(msg.getType() == QQMsg.Type.GROUP_MSG || msg.getType() == QQMsg.Type.DISCUZ_MSG) {
      if(getContext().getSession().getCfaceKey() == null || getContext().getSession().getCfaceKey().equals("")) {
        final ProcActionFuture future = new ProcActionFuture(listener, true);
        getCFaceSig(new QQActionListener() {
         
          @Override
          public void onActionEvent(QQActionEvent event) {
            if(event.getType() == QQActionEvent.Type.EVT_OK) {
              if(!future.isCanceled()){
View Full Code Here

Examples of iqq.im.QQActionListener

  }
 
 
  private void doGetLoginSig(final ProcActionFuture future){
    LoginModule login = (LoginModule) getContext().getModule(QQModule.Type.LOGIN);
    login.getLoginSig(new QQActionListener() {
      @Override
      public void onActionEvent(QQActionEvent event) {
        if(event.getType()==QQActionEvent.Type.EVT_OK){
          doCheckVerify(future);
        }else if(event.getType()==QQActionEvent.Type.EVT_ERROR){
View Full Code Here

Examples of iqq.im.QQActionListener

    if (future.isCanceled()) {
      return;
    }
    QQAccount account = getContext().getAccount();
    LoginModule login = (LoginModule) getContext().getModule(QQModule.Type.LOGIN);
    login.getCaptcha(account.getUin(), new QQActionListener() {
      public void onActionEvent(QQActionEvent event) {
        if(event.getType()==QQActionEvent.Type.EVT_OK){
          QQNotifyEventArgs.ImageVerify verify = new QQNotifyEventArgs.ImageVerify();
         
          verify.type = QQNotifyEventArgs.ImageVerify.VerifyType.LOGIN;
View Full Code Here

Examples of iqq.im.QQActionListener

      return;
    }

    LoginModule login = getContext().getModule(QQModule.Type.LOGIN);
    final QQAccount account = getContext().getAccount();
    login.checkVerify(account.getUsername(), new QQActionListener() {
      public void onActionEvent(QQActionEvent event) {
        if (event.getType() == QQActionEvent.Type.EVT_OK) {
          QQActionEventArgs.CheckVerifyArgs args =
            (QQActionEventArgs.CheckVerifyArgs) (event.getTarget());
          account.setUin(args.uin);
View Full Code Here

Examples of iqq.im.QQActionListener

  private void doWebLogin(String verifyCode, final ProcActionFuture future) {
    LoginModule login =  getContext().getModule(QQModule.Type.LOGIN);
    QQAccount account = getContext().getAccount();
    login.webLogin(account.getUsername(), account.getPassword(),
        account.getUin(), verifyCode, new QQActionListener() {
          public void onActionEvent(QQActionEvent event) {
            if (event.getType() == QQActionEvent.Type.EVT_OK) {
              doCheckLoginSig( (String) event.getTarget(),future);
            } else if (event.getType() == QQActionEvent.Type.EVT_ERROR) {
              QQException ex = (QQException) (event.getTarget());
View Full Code Here

Examples of iqq.im.QQActionListener

        });
  }
 
  private void doCheckLoginSig(String checkSigUrl, final ProcActionFuture future){
    LoginModule login =  getContext().getModule(QQModule.Type.LOGIN);
    login.checkLoginSig(checkSigUrl, new QQActionListener() {
      @Override
      public void onActionEvent(QQActionEvent event) {
        if (event.getType() == QQActionEvent.Type.EVT_OK) {
          doChannelLogin(future);
        } else if (event.getType() == QQActionEvent.Type.EVT_ERROR) {
View Full Code Here

Examples of iqq.im.QQActionListener

    });
  }

  private void doChannelLogin(final ProcActionFuture future) {
    LoginModule login = getContext().getModule(QQModule.Type.LOGIN);
    login.channelLogin(getContext().getAccount().getStatus(), new QQActionListener() {
      public void onActionEvent(QQActionEvent event) {
        if (event.getType() == QQActionEvent.Type.EVT_OK) {
          future.notifyActionEvent(QQActionEvent.Type.EVT_OK, null);
        } else if (event.getType() == QQActionEvent.Type.EVT_ERROR) {
          future.notifyActionEvent(QQActionEvent.Type.EVT_ERROR,
View Full Code Here

Examples of iqq.im.QQActionListener

  public QQActionFuture relogin(QQStatus status, final QQActionListener listener){
    getContext().getAccount().setStatus(status);
    getContext().getSession().setState(QQSession.State.LOGINING);
    LoginModule login = getContext().getModule(QQModule.Type.LOGIN);
    LOG.info("iqq client relogin...");
    QQActionFuture future = login.channelLogin(status, new QQActionListener() {
     
      @Override
      public void onActionEvent(QQActionEvent event) {
        if(event.getType() == QQActionEvent.Type.EVT_ERROR) {
          LOG.info("iqq client reloginChannel fail!!! use relogin.");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.