/** {@inheritDoc} */ public override QQHttpRequest onBuildRequest() { ApacheHttpService httpService = getContext().getSerivce(); QQSession session = getContext().getSession(); Random rand = new Random(); if (session.getClientId() == 0) { session.setClientId(rand.Next()); //random?? } JSONObject json = new JSONObject(); json.put("status", "online"); json.put("ptwebqq", httpService.getCookie("ptwebqq", QQConstants.URL_CHANNEL_LOGIN).Value); json.put("passwd_sig", ""); json.put("clientid", session.getClientId()); json.put("psessionid", session.getSessionId()); QQHttpRequest req = createHttpRequest("POST", QQConstants.URL_CHANNEL_LOGIN); req.addPostValue("r", json.ToString()); req.addPostValue("clientid", session.getClientId() + ""); req.addPostValue("psessionid", session.getSessionId()); //req.addHeader("Referer", QQConstants.REFFER); return(req); }
/** {@inheritDoc} */ public override QQHttpRequest onBuildRequest() { // retype:1 app:EQQ // itemlist:{"groupmask":{"321105219":"1","1638195794":"0","cAll":0,"idx":1075,"port":37883}} // vfwebqq:8b26c442e239630f250e1e74d135fd85ab78c38e7b8da1c95a2d1d560bdebd2691443df19d87e70d QQStore store = getContext().getStore(); QQSession session = getContext().getSession(); QQHttpRequest req = createHttpRequest("POST", QQConstants.URL_GROUP_MESSAGE_FILTER); req.addPostValue("retype", "1"); // 群??? req.addPostValue("app", "EQQ"); JSONObject groupmask = new JSONObject(); groupmask.put("cAll", 0); groupmask.put("idx", session.getIndex()); groupmask.put("port", session.getPort()); foreach (QQGroup g in store.getGroupList()) { if (g.getGin() > 0) { groupmask.put(g.getGin() + "", g.getMask() + ""); } } JSONObject itemlist = new JSONObject(); itemlist.put("groupmask", groupmask); req.addPostValue("itemlist", itemlist.ToString()); req.addPostValue("vfwebqq", getContext().getSession().getVfwebqq()); return(req); }
/** {@inheritDoc} */ public override QQHttpRequest onBuildRequest() { // r:{"to":2982077931,"face":0,"content":"[\"123\",[\"face\",1],\"456\",[\"face\",0],\"\",\"\\n【提示:此用户正在使用Q+ Web:http://web.qq.com/】\",[\"font\",{\"name\":\"微软雅黑\",\"size\":\"11\",\"style\":[0,0,0],\"color\":\"ffcc99\"}]]","msg_id":91310001,"clientid":"74131454","psessionid":"8368046764001e636f6e6e7365727665725f77656271714031302e3133332e34312e3230320000230700001f01026e04002aafd23f6d0000000a40484a526f4866467a476d00000028d954c71693cd99ae8c0c64b651519e88f55ce5075140346da7d957f3abefb51d0becc25c425d7cf5"} // 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 { } 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); return(req); }
public override QQHttpRequest onBuildRequest() { QQSession session = getContext().getSession(); JSONObject json = new JSONObject(); json.put("vfwebqq", session.getVfwebqq()); json.put("clientid", session.getClientId()); json.put("psessionid", session.getSessionId()); QQHttpRequest req = createHttpRequest("POST", QQConstants.URL_GET_RECENT_LIST); req.addPostValue("r", json.ToString()); req.addPostValue("clientid", session.getClientId() + ""); req.addPostValue("psessionid", session.getSessionId()); return(req); }
/** {@inheritDoc} */ public override QQHttpRequest onBuildRequest() { QQSession session = getContext().getSession(); JSONObject json = new JSONObject(); json.put("clientid", session.getClientId()); json.put("psessionid", session.getSessionId()); json.put("key", 0); // 暂时不知道什么用的 json.put("ids", new JSONArray()); // 同上 QQHttpRequest req = createHttpRequest("POST", QQConstants.URL_POLL_MSG); req.addPostValue("r", json.ToString()); req.addPostValue("clientid", session.getClientId() + ""); req.addPostValue("psessionid", session.getSessionId()); //req.setReadTimeout(70 * 1000); //req.setConnectTimeout(10 * 1000); req.addHeader("Referer", QQConstants.REFFER); return(req); }
/** {@inheritDoc} */ public override QQHttpRequest onBuildRequest() { QQSession session = getContext().getSession(); QQAccount account = (QQAccount)getContext().getAccount(); ApacheHttpService httpService = getContext().getSerivce(); Cookie 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.getHash(account.getUin() + "", ptwebqq.Value)); QQHttpRequest req = createHttpRequest("POST", QQConstants.URL_GET_USER_CATEGORIES); req.addPostValue("r", json.ToString()); req.addHeader("Referer", QQConstants.REFFER); return req; }