oicq-icalingua-plus-plus 1.26.16 → 1.26.17

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.
Files changed (2) hide show
  1. package/lib/onlinepush.js +50 -3
  2. package/package.json +3 -3
package/lib/onlinepush.js CHANGED
@@ -404,8 +404,8 @@ const push732 = {
404
404
  const seq = data[2];
405
405
  const random = data[3];
406
406
  const add = data[4] === 1;
407
- const user_id = data[5];
408
- const operator_id = data[6];
407
+ const user_id = data[5]; //这里NT上线也是uin,不需要转换
408
+ const operator_id = data[6]; //这里NT上线也是uin,不需要转换
409
409
  const user_name = String(data[10]);
410
410
  const operator_name = String(data[9]);
411
411
  this.em("notice.group.essence", {
@@ -497,13 +497,57 @@ const push732 = {
497
497
  set,
498
498
  });
499
499
  }
500
+ case 38: { // 机器人变动
501
+ const data = sub[47];
502
+ const is_join = !!data[2];
503
+ let user_id = is_join ? data[2] : data[3];
504
+ let nickname = "";
505
+ user_id = await uid2uin.call(this, String(user_id)); // 这里全是uid,老上线也是
506
+ try {
507
+ if (is_join) {
508
+ const ginfo = (await this.getGroupInfo(group_id)).data;
509
+ if (!ginfo) return;
510
+ ginfo.member_count++;
511
+ ginfo.last_join_time = timestamp();
512
+ const info = await this.getGroupMemberInfo(group_id, user_id);
513
+ nickname = info.data.nickname || info.data.card || "";
514
+ try {
515
+ if (this.gml.get(group_id).size)
516
+ ginfo.member_count = this.gml.get(group_id).size;
517
+ } catch { }
518
+ this.logger.info(`${user_id}(${nickname}) 加入了群 ${group_id}`);
519
+ this.getGroupMemberList(group_id, true);
520
+ this.em("notice.group.increase", {
521
+ group_id, user_id, nickname
522
+ });
523
+ } else {
524
+ let member, group;
525
+ try {
526
+ member = this.gml.get(group_id).get(user_id);
527
+ this.gml.get(group_id).delete(user_id);
528
+ } catch { }
529
+ this.logger.info(`${user_id}离开了群${group_id}`);
530
+ try {
531
+ this.gl.get(group_id).member_count--;
532
+ } catch { }
533
+ this.em("notice.group.decrease", {
534
+ group_id, user_id,
535
+ operator_id: user_id, dismiss: false,
536
+ member, group, time
537
+ });
538
+ }
539
+ } catch (e) {
540
+ this.logger.debug(e);
541
+ }
542
+ break;
543
+ }
500
544
  default:
501
545
  break;
502
546
  }
503
547
  if (sub[5] && sub[5][2]) {
504
548
  let str = String(sub[5][2]);
505
549
  if (str.includes("获得群主授予的")) {
506
- const user_id = sub[5][5];
550
+ const user_id = sub[5][5]; // 这里NT上线也是uin,不需要转换
507
551
  str = str.substr(0, str.length - 2);
508
552
  let title = str.substr(str.lastIndexOf("获得群主授予的") + 7);
509
553
  const _title = title;
@@ -1025,6 +1069,9 @@ async function NTMsgListener(blob, seq, sso) {
1025
1069
  const user_id = await uid2uin.call(this, String(msg[3]));
1026
1070
  const exit_type = msg[4];
1027
1071
  let operator_id, dismiss = false, member, group;
1072
+ try {
1073
+ member = this.gml.get(group_id).get(user_id);
1074
+ } catch { }
1028
1075
  if (exit_type === 0x82 || exit_type === 0x2) {
1029
1076
  operator_id = user_id;
1030
1077
  try {
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.16",
5
- "app_version": "1.26.16",
6
- "upday": "2026/08/09",
4
+ "version": "1.26.17",
5
+ "app_version": "1.26.17",
6
+ "upday": "2026/08/10",
7
7
  "protocol_version": "v11",
8
8
  "description": "oicq(https://github.com/takayama-lily/oicq) v1 for Icalingua++",
9
9
  "main": "index.js",