Examples of QQHttpRequest


Examples of iqq.im.http.QQHttpRequest

    // r:{"group_uin":3408869879,"content":"[\"群消息发送测试\",[\"face\",13],\"\",\"\\n【提示:此用户正在使用Q+ Web:http://web.qq.com/】\",[\"font\",{\"name\":\"微软雅黑\",\"size\":\"11\",\"style\":[0,0,0],\"color\":\"ffcc99\"}]]","msg_id":91310002,"clientid":"74131454","psessionid":"8368046764001e636f6e6e7365727665725f77656271714031302e3133332e34312e3230320000230700001f01026e04002aafd23f6d0000000a40484a526f4866467a476d00000028d954c71693cd99ae8c0c64b651519e88f55ce5075140346da7d957f3abefb51d0becc25c425d7cf5"}
    // clientid、psessionid

    QQSession session = getContext().getSession();
    JSONObject json = new JSONObject();
    QQHttpRequest req = null;
    if (msg.getType() == QQMsg.Type.BUDDY_MSG) {
      req = createHttpRequest("POST", QQConstants.URL_SEND_BUDDY_MSG);
      json.put("to", msg.getTo().getUin());
      json.put("face", 0); // 这个是干嘛的??
    } else if (msg.getType() == QQMsg.Type.GROUP_MSG) {
      req = createHttpRequest("POST", QQConstants.URL_SEND_GROUP_MSG);
      json.put("group_uin", msg.getGroup().getGin());
      json.put("key", session.getCfaceKey());
      json.put("sig", session.getCfaceSig());
    } else if (msg.getType() == QQMsg.Type.DISCUZ_MSG) {
      req = createHttpRequest("POST", QQConstants.URL_SEND_DISCUZ_MSG);
      json.put("did", msg.getDiscuz().getDid());
      json.put("key", session.getCfaceKey());
      json.put("sig", session.getCfaceSig());
    }else if (msg.getType() == QQMsg.Type.SESSION_MSG) {  // 临时会话消息
      req = createHttpRequest("POST", QQConstants.URL_SEND_SESSION_MSG);
      QQStranger member =  (QQStranger) msg.getTo();
      json.put("to", member.getUin());
      json.put("face", 0); // 这个是干嘛的??
      json.put("group_sig", member.getGroupSig());
      json.put("service_type", member.getServiceType() + "");
    } else {
      LOG.warn("unknown MsgType: " + msg.getType());
    }

    json.put("content", msg.packContentList());
    json.put("msg_id", 91310001 + "");
    json.put("clientid", session.getClientId());
    json.put("psessionid", session.getSessionId());

    req.addPostValue("r", json.toString());
    req.addPostValue("clientid", session.getClientId() + "");
    req.addPostValue("psessionid", session.getSessionId());
    req.addHeader("Referer", QQConstants.REFFER);

    System.out.println("sendMsg: " + json.toString());
    return req;
  }
View Full Code Here

Examples of iqq.im.http.QQHttpRequest

  /** {@inheritDoc} */
  @Override
  protected QQHttpRequest onBuildRequest() throws QQException, JSONException {
    QQSession session = getContext().getSession();
    QQHttpRequest req = createHttpRequest("GET", QQConstants.URL_GET_USER_FACE);
    req.addGetValue("uin", user.getUin() + "");
    req.addGetValue("vfwebqq", session.getVfwebqq());
    req.addGetValue("t", System.currentTimeMillis() / 1000 + "");
    req.addGetValue("cache", 0 + ""); // ??
    req.addGetValue("type", 1 + ""); // ??
    req.addGetValue("fid", 0 + ""); // ??

    req.addHeader("Referer", QQConstants.REFFER);
    return req;
  }
View Full Code Here

Examples of iqq.im.http.QQHttpRequest

  }
  // mailaction=mail_del&mailid=C1TFACD70BB&t=mail_mgr2&resp_charset=UTF8&ef=js&sid=eEVNdM8QDlC8YWEz&folderkey=1
  /** {@inheritDoc} */
  @Override
  public QQHttpRequest buildRequest() throws QQException {
    QQHttpRequest req = createHttpRequest("POST", QQConstants.URL_MARK_EMAIL);
    req.addPostValue("mailaction", "mail_del");
    req.addPostValue("t", "mail_mgr2");
    req.addPostValue("resp_charset", "UTF8");
    req.addPostValue("ef", "js");
    req.addPostValue("folderkey", "1");
    req.addPostValue("sid", getContext().getSession().getEmailAuthKey());
    for(QQEmail mail : markList) {
      req.addPostValue("mailid", mail.getId());
    }
    return req;
  }
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.