From 14e4f741eb2adcc6410c22b579b8689d023bf8e8 Mon Sep 17 00:00:00 2001 From: Richard Chien Date: Mon, 17 Apr 2017 23:17:21 +0800 Subject: [PATCH] Fix group request bug --- docs/Post.md | 1 + io.github.richardchien.coolqhttpapi.json | 4 ++-- src/app.h | 2 +- src/appmain.cpp | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/Post.md b/docs/Post.md index 13ce7d0..cd74403 100644 --- a/docs/Post.md +++ b/docs/Post.md @@ -189,6 +189,7 @@ Authorization: token kSLuTF2GC2Q4q4ugm3 | `post_type` | string | `"request"` | 上报类型 | | `request_type` | string | `"group"` | 请求类型 | | `sub_type` | string | `"add"`、`"invite"` | 请求子类型,分别表示加群请求、邀请登录号入群 | +| `group_id` | number | - | 群号 | | `user_id` | number | - | 发送请求的 QQ 号 | | `message` | string | - | 验证信息 | | `flag` | string | - | 请求 flag,在调用处理请求的 API 时需要传入 | diff --git a/io.github.richardchien.coolqhttpapi.json b/io.github.richardchien.coolqhttpapi.json index cc5c674..84f4b4e 100644 --- a/io.github.richardchien.coolqhttpapi.json +++ b/io.github.richardchien.coolqhttpapi.json @@ -5,8 +5,8 @@ "ret": 1, // 룬̶Ϊ1 "apiver": 9, // Api汾SDKΪ9 "name": "HTTP API", // Ӧ - "version": "1.1.1", // Ӧð汾 - "version_id": 11, // Ӧ˳汾ÿηʱ+1 + "version": "1.1.2", // Ӧð汾 + "version_id": 12, // Ӧ˳汾ÿηʱ+1 "author": "Richard Chien", // Ӧ "description": "ʹ Q ֧ͨ HTTP ϱ¼Ϣýӿ", "event": [// ¼бͬһ¼Ϳظ壨ǰɾ¼ diff --git a/src/app.h b/src/app.h index 40ea54c..4d82dbf 100644 --- a/src/app.h +++ b/src/app.h @@ -3,5 +3,5 @@ #define CQAPPID "io.github.richardchien.coolqhttpapi" #define CQAPPINFO CQAPIVERTEXT "," CQAPPID #define CQAPPNAME "CoolQ HTTP API Plugin" -#define CQAPPVER "v1.1.1" +#define CQAPPVER "v1.1.2" #define CQAPPFULLNAME CQAPPNAME " " CQAPPVER diff --git a/src/appmain.cpp b/src/appmain.cpp index a2de400..6f723b8 100644 --- a/src/appmain.cpp +++ b/src/appmain.cpp @@ -602,11 +602,12 @@ CQEVENT(int32_t, __eventRequest_AddGroup, 32) sub_type_str = "invite"; break; } - json_t *json = json_pack("{s:s, s:s, s:s, s:i, s:I, s:s, s:s}", + json_t *json = json_pack("{s:s, s:s, s:s, s:i, s:I, s:I, s:s, s:s}", "post_type", "request", "request_type", "group", "sub_type", sub_type_str, "time", send_time, + "group_id", from_group, "user_id", from_qq, "message", gbk_to_utf8(msg).c_str(), "flag", gbk_to_utf8(response_flag).c_str());