oicq-icalingua-plus-plus 1.26.9 → 1.26.11

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/index.d.ts CHANGED
@@ -364,6 +364,7 @@ export interface ReplyElem {
364
364
  data: {
365
365
  id: string, //message_id
366
366
  text?: string, //消息文本内容,当获取原消息失败时使用
367
+ message?: MessageElem[], //原消息链,当获取原消息失败时使用
367
368
  }
368
369
  }
369
370
 
@@ -275,44 +275,97 @@ async function makeForwardMsg(iterable, dm = false, target = 0, nt = true, retry
275
275
  time = parsed.readUInt32BE(12);
276
276
  }
277
277
  source = buildTextElem(elem.data.text || " ");
278
- elements.push({
279
- 45: {
280
- 1: [seq],
281
- 2: user_id,
282
- 3: time,
283
- 4: 1,
284
- 5: source,
285
- 6: 0,
286
- 8: {
287
- 3: common.genMessageUuid(_random)
288
- },
289
- 9: {
290
- 1: {
291
- 1: user_id,
292
- 2: 0,
293
- 3: group_id ? 82 : 9,
294
- 4: group_id ? 0 : 175,
295
- 5: seq,
296
- 6: time,
297
- 7: 0,
298
- 9: !group_id ? null : {
299
- 1: group_id,
300
- },
278
+ if (!nt) {
279
+ elements.push({
280
+ 45: {
281
+ 1: [seq],
282
+ 2: user_id,
283
+ 3: time,
284
+ 4: 1,
285
+ 5: source,
286
+ 6: 0,
287
+ 8: {
288
+ 3: common.genMessageUuid(_random)
301
289
  },
302
- 2: {
303
- 1: 1,
304
- 2: 0,
305
- 3: 0,
306
- 4: 0,
290
+ 9: {
291
+ 1: {
292
+ 1: user_id,
293
+ 2: 0,
294
+ 3: group_id ? 82 : 9,
295
+ 4: group_id ? 0 : 175,
296
+ 5: seq,
297
+ 6: time,
298
+ 7: 0,
299
+ 8: {
300
+ 6: group_id ? null : "",
301
+ 11: 1,
302
+ },
303
+ 9: !group_id ? null : {
304
+ 1: group_id,
305
+ 4: "", //nickname
306
+ 5: 2,
307
+ 10: 1,
308
+ },
309
+ },
310
+ 2: {
311
+ 1: 1,
312
+ 2: 0,
313
+ 3: 0,
314
+ 4: 0,
315
+ },
316
+ 3: {
317
+ 1: {
318
+ 2: source
319
+ }
320
+ }
321
+ }
322
+ }
323
+ });
324
+ } else {
325
+ elements.push({
326
+ 45: {
327
+ 1: [seq],
328
+ 2: user_id,
329
+ 3: time,
330
+ 4: 1,
331
+ 5: source,
332
+ 6: 0,
333
+ 8: {
334
+ 3: common.genMessageUuid(_random)
307
335
  },
308
- 3: {
336
+ 9: {
309
337
  1: {
310
- 2: source
338
+ 1: user_id,
339
+ 7: {
340
+ 6: group_id ? null : "", //nickname
341
+ 11: 1,
342
+ },
343
+ 8: !group_id ? null : {
344
+ 1: group_id,
345
+ 4: "", //nickname
346
+ 5: 2,
347
+ 10: 1,
348
+ },
349
+ },
350
+ 2: {
351
+ 1: group_id ? 82 : 9,
352
+ 2: group_id ? null : 175,
353
+ 3: group_id ? null : 175,
354
+ 4: _random,
355
+ 5: seq,
356
+ 6: time,
357
+ 7: 1,
358
+ 11: group_id ? null : seq, //nt seq
359
+ },
360
+ 3: {
361
+ 1: {
362
+ 2: source
363
+ }
311
364
  }
312
365
  }
313
366
  }
314
- }
315
- });
367
+ });
368
+ }
316
369
  break;
317
370
  case "xml":
318
371
  elements.push(await buildXmlElem(elem.data.data, elem.data.type));
@@ -713,6 +713,7 @@ class Parser {
713
713
  };
714
714
  let seq = elem[1], user_id = elem[2]
715
715
  let replyed = elem[5] ? (Array.isArray(elem[5]) ? elem[5] : [elem[5]]) : [];
716
+ let original = elem[9];
716
717
  if (this.gid) {
717
718
  let random = elem[8] ? genRandom(elem[8][3]) : null;
718
719
  let time = elem[3];
@@ -737,6 +738,19 @@ class Parser {
737
738
  msg.data.text += "[图片]";
738
739
  }
739
740
  }
741
+ if (original) {
742
+ try {
743
+ if (this.gid) {
744
+ const msgs = await Parser.invoke(this, user_id, this.gid, original[3][1]);
745
+ msg.data.message = parser.message;
746
+ } else {
747
+ const msgs = await Parser.invoke(this, user_id, 0, original[3][1]);
748
+ msg.data.message = parser.message;
749
+ }
750
+ } catch (e) {
751
+ this.c.logger.error("解析回复原消息失败", e);
752
+ }
753
+ }
740
754
  this.message.unshift(msg);
741
755
  this.raw_message = (this.c.config.brief ? "[回复]" : genCQMsg(msg)) + this.raw_message;
742
756
  } catch { }
package/lib/onlinepush.js CHANGED
@@ -7,7 +7,7 @@ const pb = require("./algo/pb");
7
7
  const jce = require("./algo/jce");
8
8
  const sysmsg = require("./core/sysmsg");
9
9
  const { parseC2CMsg ,parseGroupMsg, parseDiscussMsg } = require("./message/parser");
10
- const { genC2CMessageId, genGroupMessageId, log, uin2code, BUF0 } = require("./common");
10
+ const { genC2CMessageId, genGroupMessageId, log, uin2code, BUF0, timestamp } = require("./common");
11
11
  const { updateFL, uid2uin } = require("./core/friendlist");
12
12
 
13
13
  /**
@@ -173,7 +173,7 @@ const push528 = {
173
173
  if (Array.isArray(data))
174
174
  data = data[0];
175
175
  let user_id = data[1], operator_id = data[1], flag = 0;
176
- if (user_id === this.uin) {
176
+ if (user_id === this.uin || String(user_id) === this.uid) {
177
177
  user_id = data[2];
178
178
  flag = 1;
179
179
  }
@@ -362,13 +362,14 @@ const push732 = {
362
362
  });
363
363
  },
364
364
  0x11: async function (group_id, buf, time) {
365
- const data = pb.decode(buf.slice(7))[11];
365
+ const o = pb.decode(buf.slice(7));
366
+ const data = o[11] || o;
366
367
  let operator_id = data[1];
367
368
  const msg = Array.isArray(data[3]) ? data[3][0] : data[3];
368
369
  let user_id = msg[6];
369
370
  if (this.config.useNT) {
370
371
  //nt uid
371
- await this.getGroupMemberList(group_id);
372
+ //await this.getGroupMemberList(group_id);
372
373
  user_id = String(user_id), operator_id = String(operator_id);
373
374
  user_id = await uid2uin.call(this, user_id);
374
375
  operator_id = await uid2uin.call(this, operator_id);
@@ -800,46 +801,54 @@ async function NTMsgListener(blob, seq, sso) {
800
801
  }
801
802
  break;
802
803
  case 33: //群员入群
803
- const group_id = uin2code(o[1][1][1]);
804
- const msg = o[1][3][2];
805
- const user_uid = String(msg[3]);
806
- const user_id = await uid2uin.call(this, user_uid);
807
- let nickname = "";
808
- const ginfo = (await this.getGroupInfo(group_id)).data;
809
- if (!ginfo) return;
810
- if (user_id === this.uin) {
811
- nickname = this.nickname;
812
- this.logger.info(`更新了群列表,新增了群:${group_id}`);
813
- } else {
814
- ginfo.member_count++;
815
- ginfo.last_join_time = timestamp();
816
- const info = await this.getGroupMemberInfo(group_id, user_id);
817
- nickname = info.data.nickname || info.data.card || "";
818
- try {
819
- if (this.gml.get(group_id).size)
820
- ginfo.member_count = this.gml.get(group_id).size;
821
- } catch { }
822
- this.logger.info(`${user_id}(${nickname}) 加入了群 ${group_id}`);
804
+ try {
805
+ const group_id = uin2code(o[1][1][1]);
806
+ const msg = o[1][3][2];
807
+ const user_uid = String(msg[3]);
808
+ const user_id = await uid2uin.call(this, user_uid);
809
+ let nickname = "";
810
+ const ginfo = (await this.getGroupInfo(group_id)).data;
811
+ if (!ginfo) return;
812
+ if (user_id === this.uin) {
813
+ nickname = this.nickname;
814
+ this.logger.info(`更新了群列表,新增了群:${group_id}`);
815
+ } else {
816
+ ginfo.member_count++;
817
+ ginfo.last_join_time = timestamp();
818
+ const info = await this.getGroupMemberInfo(group_id, user_id);
819
+ nickname = info.data.nickname || info.data.card || "";
820
+ try {
821
+ if (this.gml.get(group_id).size)
822
+ ginfo.member_count = this.gml.get(group_id).size;
823
+ } catch { }
824
+ this.logger.info(`${user_id}(${nickname}) 加入了群 ${group_id}`);
825
+ }
826
+ this.getGroupMemberList(group_id, true);
827
+ this.em("notice.group.increase", {
828
+ group_id, user_id, nickname
829
+ });
830
+ } catch (e) {
831
+ this.logger.debug(e);
823
832
  }
824
- this.getGroupMemberList(group_id, true);
825
- this.em("notice.group.increase", {
826
- group_id, user_id, nickname
827
- });
828
833
  break;
829
834
  case 38: //建群
830
835
  case 85: //群申请被同意
831
- const group_id = uin2code(o[1][1][1]);
832
- const user_id = this.uin;
833
- const nickname = this.nickname;
834
- const ginfo = (await this.getGroupInfo(group_id)).data;
835
- if (!ginfo) return;
836
- if (user_id === this.uin) {
837
- this.logger.info(`更新了群列表,新增了群:${group_id}`);
838
- this.getGroupMemberList(group_id);
836
+ try {
837
+ const group_id = uin2code(o[1][1][1]);
838
+ const user_id = this.uin;
839
+ const nickname = this.nickname;
840
+ const ginfo = (await this.getGroupInfo(group_id)).data;
841
+ if (!ginfo) return;
842
+ if (user_id === this.uin) {
843
+ this.logger.info(`更新了群列表,新增了群:${group_id}`);
844
+ this.getGroupMemberList(group_id);
845
+ }
846
+ this.em("notice.group.increase", {
847
+ group_id, user_id, nickname
848
+ });
849
+ } catch (e) {
850
+ this.logger.debug(e);
839
851
  }
840
- this.em("notice.group.increase", {
841
- group_id, user_id, nickname
842
- });
843
852
  break;
844
853
  case 141: //陌生人
845
854
  case 166: //好友
@@ -934,7 +943,7 @@ function groupNTMsgConverter(msg) {
934
943
  this.uin2uid_map.set(uin, uid);
935
944
  }
936
945
 
937
- header[9] = headerNT[8];
946
+ header[9] = headerNT[8]; //CommonGroup
938
947
  header[6] = contentNT[6];
939
948
  header[5] = contentNT[5];
940
949
  header[11] = headerNT[4];
@@ -967,6 +976,7 @@ function c2cNTMsgConverter(msg) {
967
976
  header[5] = contentNT[5];
968
977
  header[6] = contentNT[6];
969
978
  header[7] = contentNT[12];
979
+ header[8] = headerNT[7]; //CommonC2C
970
980
 
971
981
  return {
972
982
  1: header,
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.26.9",
5
- "app_version": "1.26.9",
6
- "upday": "2026/07/19",
4
+ "version": "1.26.11",
5
+ "app_version": "1.26.11",
6
+ "upday": "2026/07/31",
7
7
  "protocol_version": "v11",
8
8
  "description": "oicq(https://github.com/takayama-lily/oicq) v1 for Icalingua++",
9
9
  "main": "index.js",