oicq-icalingua-plus-plus 1.22.5 → 1.22.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/http-api/api.js CHANGED
@@ -6,7 +6,7 @@ let bot;
6
6
  class NotFoundError extends Error {}
7
7
 
8
8
  const available_actions = [
9
- "sendPrivateMsg",
9
+ "_sendPrivateMsg",
10
10
  "sendGroupMsg",
11
11
  "sendDiscussMsg",
12
12
  "sendMsg",
@@ -116,7 +116,7 @@ function toHump(action) {
116
116
 
117
117
  function quickOperate(event, res) {
118
118
  if (event.post_type === "message" && res.reply) {
119
- const action = event.message_type === "private" ? "sendPrivateMsg" : "sendGroupMsg";
119
+ const action = event.message_type === "private" ? "_sendPrivateMsg" : "sendGroupMsg";
120
120
  const id = event.message_type === "private" ? event.user_id : event.group_id;
121
121
  bot[action](id, res.reply, res.auto_escape);
122
122
  if (event.group_id) {
package/http-api/core.js CHANGED
@@ -460,7 +460,7 @@ function loop() {
460
460
  if (bot.gl.has(target))
461
461
  bot.sendGroupMsg(target, abc[1]);
462
462
  else
463
- bot.sendPrivateMsg(target, abc[1]);
463
+ bot._sendPrivateMsg(target, abc[1]);
464
464
  break;
465
465
  case "eval":
466
466
  try {
package/index.d.ts CHANGED
@@ -933,7 +933,7 @@ export class Client extends EventEmitter {
933
933
  getGroupInfo(group_id: number, no_cache?: boolean): Promise<Ret<GroupInfo>>;
934
934
 
935
935
  /** 私聊 */
936
- sendPrivateMsg(user_id: number, message: Sendable, auto_escape?: boolean): Promise<Ret<{ message_id: string }>>;
936
+ _sendPrivateMsg(user_id: number, message: Sendable, auto_escape?: boolean): Promise<Ret<{ message_id: string }>>;
937
937
  /** 群聊 */
938
938
  sendGroupMsg(group_id: number, message: Sendable, auto_escape?: boolean): Promise<Ret<{ message_id: string }>>;
939
939
  /** 群临时会话,大多数时候可以使用私聊达到同样效果 */
@@ -962,7 +962,7 @@ export class Client extends EventEmitter {
962
962
  * resid在xml消息中,需要自行解析xml获得
963
963
  * 暂不支持套娃转发解析
964
964
  */
965
- getForwardMsg(resid: string): Promise<Ret<Array<{
965
+ getForwardMsg(resid: string, fileName?: string): Promise<Ret<Array<{
966
966
  group_id?: number,
967
967
  user_id: number,
968
968
  nickname: string,
package/lib/client-ext.js CHANGED
@@ -288,7 +288,7 @@ Client.prototype.pbGetMsg = async function () {
288
288
  try {
289
289
  const data = await parseC2CMsg.call(this, msg, true);
290
290
  if (data && data.raw_message) {
291
- data.reply = (message, auto_escape = false) => this.sendPrivateMsg(data.user_id, message, auto_escape);
291
+ data.reply = (message, auto_escape = false) => this._sendPrivateMsg(data.user_id, message, auto_escape);
292
292
  this.logger.info(`recv from: [Private: ${data.user_id}(${data.sub_type})] ` + data.raw_message);
293
293
  this.em("message.private." + data.sub_type, data);
294
294
  }
package/lib/client.js CHANGED
@@ -348,7 +348,7 @@ class Client extends EventEmitter {
348
348
 
349
349
  ///////////////////////////////////////////////////
350
350
 
351
- sendPrivateMsg(user_id, message = "", auto_escape = false) {
351
+ _sendPrivateMsg(user_id, message = "", auto_escape = false) {
352
352
  return this._useProtocol(chat.sendMsg, [user_id, message, auto_escape, 0]);
353
353
  }
354
354
  sendGroupMsg(group_id, message = "", auto_escape = false) {
@@ -372,7 +372,7 @@ class Client extends EventEmitter {
372
372
  getChatHistory(message_id, count = 10) {
373
373
  return this._useProtocol(chat.getMsgs, arguments);
374
374
  }
375
- getForwardMsg(id) {
375
+ getForwardMsg(id, fileName = "MultiMsg") {
376
376
  return this._useProtocol(chat.getForwardMsg, arguments);
377
377
  }
378
378
  makeForwardMsg(fakes, dm = false, target = 0) {
package/lib/device.js CHANGED
@@ -154,20 +154,32 @@ const apk = {
154
154
  bitmap: 150470524,
155
155
  sigmap: 1970400,
156
156
  sdkver: "6.0.0.2487",
157
+ },
158
+
159
+ //android watch
160
+ 3: {
161
+ id: "com.tencent.qqlite",
162
+ name: "A2.0.5",
163
+ version: "2.0.5",
164
+ ver: "2.0.5",
165
+ sign: Buffer.from([166, 183, 69, 191, 36, 162, 194, 119, 82, 119, 22, 246, 243, 110, 182, 141]),
166
+ buildtime: 1559564731,
167
+ appid: 16,
168
+ subid: 537064446,
169
+ bitmap: 16252796,
170
+ sigmap: 34869472,
171
+ sdkver: "6.0.0.236",
157
172
  }
158
173
  };
159
174
 
160
- //android watch
161
- apk[3] = { ...apk[1] };
162
- apk[3].subid = 537061176;
163
175
 
164
176
  //mac (experimental)
165
177
  apk[4] = { ...apk[2] };
166
- apk[4].subid = 537064315;
178
+ apk[4].subid = 537128930;
167
179
 
168
180
  //ipad (experimental)
169
181
  apk[5] = { ...apk[2] };
170
- apk[5].subid = 537065739;
182
+ apk[5].subid = 537118796;
171
183
 
172
184
  /**
173
185
  * @param {number} platform
@@ -232,8 +232,8 @@ async function getMsgs(message_id, count = 20) {
232
232
  * @param {string} resid
233
233
  * @returns {import("../ref").ProtocolResponse}
234
234
  */
235
- function getForwardMsg(resid) {
236
- return parseForwardMsg.call(this, resid);
235
+ function getForwardMsg(resid, fileName = "MultiMsg") {
236
+ return parseForwardMsg.call(this, resid, fileName);
237
237
  }
238
238
 
239
239
  /**
@@ -264,6 +264,10 @@ const map = {
264
264
  334: "/虎虎生威",
265
265
  335: "/绿马护体",
266
266
  336: "/豹富",
267
+ 337: "/花朵脸",
268
+ 338: "/我想开了",
269
+ 339: "/舔屏",
270
+ 340: "/热化了",
267
271
  };
268
272
 
269
273
  const FACE_OLD_BUF = Buffer.from([0x00, 0x01, 0x00, 0x04, 0x52, 0xCC, 0xF5, 0xD0]);
@@ -737,13 +737,22 @@ async function parseDiscussMsg(msg) {
737
737
  * @param {string} resid
738
738
  * @returns {import("../ref").ProtocolResponse}
739
739
  */
740
- async function parseForwardMsg(resid) {
740
+ async function parseForwardMsg(resid, fileName) {
741
741
  const data = [];
742
742
  const blob = await _downloadMultiMsg.call(this, String(resid), 2);
743
743
  /**
744
744
  * @type {import("../ref").Msg[]}
745
745
  */
746
746
  let msgs = pb.decode(blob)[2];
747
+ if (!Array.isArray(msgs))
748
+ msgs = [msgs];
749
+ for (let msg1 of msgs) {
750
+ const m_fileName = msg1[1].toString();
751
+ if (m_fileName === fileName) {
752
+ msgs = msg1;
753
+ break;
754
+ }
755
+ }
747
756
  if (Array.isArray(msgs))
748
757
  msgs = msgs[0];
749
758
  msgs = msgs[2][1];
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "oicq-icalingua-plus-plus",
3
3
  "app_name": "oicq-icalingua-plus-plus",
4
- "version": "1.22.5",
5
- "app_version": "1.22.4",
6
- "upday": "2022/06/04",
4
+ "version": "1.22.9",
5
+ "app_version": "1.22.9",
6
+ "upday": "2022/09/06",
7
7
  "protocol_version": "v11",
8
8
  "description": "oicq(https://github.com/takayama-lily/oicq) v1 for Icalingua++",
9
9
  "main": "index.js",