Package iqq.im.bean

Examples of iqq.im.bean.QQAccount


  @Override
  protected void onHttpStatusOK(QQHttpResponse response) throws QQException, JSONException {
    //{"retcode":0,"result":{"uin":236557647,"cip":1991953329,"index":1075,"port":51494,"status":"online","vfwebqq":"41778677efd86bae2ed575eea02349046a36f3f53298a34b97d75297ec1e67f6ee5226429daa6aa7","psessionid":"8368046764001d636f6e6e7365727665725f77656271714031302e3133332e342e31373200005b9200000549016e04004f95190e6d0000000a4052347371696a62724f6d0000002841778677efd86bae2ed575eea02349046a36f3f53298a34b97d75297ec1e67f6ee5226429daa6aa7","user_state":0,"f":0}}
    JSONObject json = new JSONObject(response.getResponseString());
    QQSession session = getContext().getSession();
    QQAccount account = getContext().getAccount();
    if(json.getInt("retcode") == 0){
      JSONObject ret = json.getJSONObject("result");
      account.setUin(ret.getLong("uin"));
      account.setQQ(ret.getLong("uin"));
      session.setSessionId(ret.getString("psessionid"));
      session.setVfwebqq(ret.getString("vfwebqq"));
      account.setStatus(QQStatus.valueOfRaw(ret.getString("status")));
      session.setState(QQSession.State.ONLINE);
      session.setIndex(ret.getInt("index"));
      session.setPort(ret.getInt("port"));
      notifyActionEvent(QQActionEvent.Type.EVT_OK, null);
    }else{
View Full Code Here


  @Override
  public QQHttpRequest onBuildRequest() throws QQException, JSONException {
        HttpService httpService = (HttpService) getContext().getSerivce(QQService.Type.HTTP);
        QQHttpCookie ptwebqq = httpService.getCookie("ptwebqq", QQConstants.URL_GET_USER_CATEGORIES);
    QQSession session = getContext().getSession();
        QQAccount account = getContext().getAccount();

    JSONObject json = new JSONObject();
    json.put("vfwebqq", session.getVfwebqq());
        json.put("hash", QQEncryptor.hash(account.getUin() + "", ptwebqq.getValue()));

    QQHttpRequest req = createHttpRequest("POST",
        QQConstants.URL_GET_GROUP_NAME_LIST);
    req.addPostValue("r", json.toString());
View Full Code Here

  /** {@inheritDoc} */
  @Override
  public QQHttpRequest onBuildRequest() throws QQException, JSONException {
    QQSession session = getContext().getSession();
    QQAccount account = getContext().getAccount();
    HttpService httpService = (HttpService) getContext().getSerivce(QQService.Type.HTTP);
    QQHttpCookie ptwebqq = httpService.getCookie("ptwebqq", QQConstants.URL_GET_USER_CATEGORIES);
   
    JSONObject json = new JSONObject();
    json.put("h", "hello");
    json.put("vfwebqq", session.getVfwebqq()); // 同上
    json.put("hash", QQEncryptor.hash(account.getUin() + "", ptwebqq.getValue()));

    QQHttpRequest req = createHttpRequest("POST",
        QQConstants.URL_GET_USER_CATEGORIES);
    req.addPostValue("r", json.toString());

View Full Code Here

    this.modules.put(QQModule.Type.DISCUZ, new DiscuzModule());
    this.modules.put(QQModule.Type.EMAIL, new EmailModule());

    this.services.put(QQService.Type.HTTP, new ApacheHttpService());

    this.account = new QQAccount();
    this.account.setUsername(username);
    this.account.setPassword(password);
    this.session = new QQSession();
    this.store = new QQStore();
    this.notifyListener = notifyListener;
View Full Code Here

 
  private void doGetVerify(final String reason, final ProcActionFuture future){
    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

    if (future.isCanceled()) {
      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);
          if (args.result == 0) {
            doWebLogin(args.code, future);
          } else {
            doGetVerify("为了保证您账号的安全,请输入验证码中字符继续登录。", future);
          }
View Full Code Here

    });
  }

  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

          } else if(session.getState() != QQSession.State.KICKED) {
            relogin();
          }
        }else if(event.getType() == QQActionEvent.Type.EVT_ERROR){
          QQSession session = getContext().getSession();
          QQAccount account = getContext().getAccount();
          session.setState(QQSession.State.OFFLINE);
          account.setStatus(QQStatus.OFFLINE);
          //因为自带了错误重试机制,如果出现了错误回调,表明已经超时多次均失败,这里直接返回网络错误的异常
          QQException ex = (QQException) event.getTarget();
          QQErrorCode code = ex.getError();
          if(code == QQErrorCode.INVALID_LOGIN_AUTH) {
            relogin();
View Full Code Here

TOP

Related Classes of iqq.im.bean.QQAccount

Copyright © 2018 www.massapicom. 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.