llonebot-dist 7.9.3 → 7.10.1

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/llbot.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as path from "node:path";
2
2
  import path__default, { resolve, dirname } from "node:path";
3
- import fsPromise, { writeFile, stat, unlink, copyFile, readFile, access, mkdir } from "node:fs/promises";
3
+ import fsPromise, { writeFile, stat, unlink, mkdir, copyFile, readFile, access } from "node:fs/promises";
4
4
  import require$$0$9, { existsSync as existsSync$1 } from "fs";
5
5
  import require$$0$6 from "util";
6
6
  import require$$0$5 from "stream";
@@ -5895,6 +5895,24 @@ var require_index$1 = __commonJS$1({
5895
5895
  }, "Schema");
5896
5896
  Schema.prototype = Object.create(Function.prototype);
5897
5897
  Schema.prototype[kSchema] = true;
5898
+ Object.defineProperty(Schema.prototype, "~standard", {
5899
+ get() {
5900
+ return {
5901
+ version: 1,
5902
+ vendor: "schemastery",
5903
+ validate: /* @__PURE__ */ __name$8((value) => {
5904
+ try {
5905
+ return { value: Schema.resolve(value, this, {})[0] };
5906
+ } catch (error2) {
5907
+ if (ValidationError.is(error2)) {
5908
+ return { issues: [{ message: error2.message, path: error2.options.path }] };
5909
+ }
5910
+ throw error2;
5911
+ }
5912
+ }, "validate")
5913
+ };
5914
+ }
5915
+ });
5898
5916
  Schema.ValidationError = ValidationError;
5899
5917
  Schema.prototype.toJSON = /* @__PURE__ */ __name$8(function toJSON() {
5900
5918
  if (globalThis.__schemastery_refs__) {
@@ -9197,6 +9215,9 @@ function extractOrientation(exifBlock, isBigEndian) {
9197
9215
  return;
9198
9216
  }
9199
9217
  const block = exifBlock.slice(start, end);
9218
+ if (block.length < IDF_ENTRY_BYTES) {
9219
+ return;
9220
+ }
9200
9221
  const tagNumber = readUInt(block, 16, 0, isBigEndian);
9201
9222
  if (tagNumber === 274) {
9202
9223
  const dataFormat = readUInt(block, 16, 2, isBigEndian);
@@ -10397,7 +10418,7 @@ function isNumeric(str) {
10397
10418
  }
10398
10419
  function calcQQLevel(level) {
10399
10420
  const { penguinNum, crownNum, sunNum, moonNum, starNum } = level;
10400
- return (penguinNum || 0) * 256 + crownNum * 64 + sunNum * 16 + moonNum * 4 + starNum;
10421
+ return (penguinNum ?? 0) * 256 + crownNum * 64 + sunNum * 16 + moonNum * 4 + starNum;
10401
10422
  }
10402
10423
  function mergeNewProperties(newObj, oldObj) {
10403
10424
  Object.keys(newObj).forEach((key2) => {
@@ -11797,7 +11818,7 @@ class WebUITokenUtil {
11797
11818
  }
11798
11819
  const webuiTokenUtil = new WebUITokenUtil(path__default.join(DATA_DIR, "webui_token.txt"));
11799
11820
  const logFileName = `llbot-${(/* @__PURE__ */ new Date()).toLocaleString("zh-CN")}.log`.replace(/\//g, "-").replace(/:/g, "-");
11800
- const version$3 = "7.9.3";
11821
+ const version$3 = "7.10.1";
11801
11822
  var utils$4 = { exports: {} };
11802
11823
  var windows;
11803
11824
  var hasRequiredWindows;
@@ -16045,7 +16066,7 @@ function UserMixin(Base) {
16045
16066
  });
16046
16067
  const res = await this.httpSendPB("MQUpdateSvc_com_qq_ti.web.OidbSvc.0xdef_1", body);
16047
16068
  const { json: json2 } = Action.FetchUserLoginDaysResp.decode(Buffer.from(res.pb, "hex"));
16048
- return JSON.parse(json2).msg_rsp_basic_info.rpt_msg_basic_info.find((e) => e.uint64_uin === uin)?.uint32_login_days || 0;
16069
+ return JSON.parse(json2).msg_rsp_basic_info.rpt_msg_basic_info.find((e) => e.uint64_uin === uin)?.uint32_login_days ?? 0;
16049
16070
  }
16050
16071
  };
16051
16072
  }
@@ -16506,26 +16527,18 @@ class Core extends Service2 {
16506
16527
  sentMsgIds.set(payload.msgId, true);
16507
16528
  });
16508
16529
  const groupNotifyIgnore = [];
16509
- registerReceiveHook(ReceiveCmdS.UNREAD_GROUP_NOTIFY, async (payload) => {
16510
- const [doubt, oldestUnreadSeq, unreadCount] = payload;
16511
- if (unreadCount) {
16512
- let notifies;
16513
- try {
16514
- notifies = (await this.ctx.ntGroupApi.getSingleScreenNotifies(doubt, unreadCount)).notifies;
16515
- } catch (e) {
16516
- return;
16530
+ registerReceiveHook("nodeIKernelGroupListener/onGroupNotifiesUpdated", async (payload) => {
16531
+ const [doubt, notifies] = payload;
16532
+ for (const notify of notifies) {
16533
+ const notifyTime = Math.trunc(+notify.seq / 1e3 / 1e3);
16534
+ if (groupNotifyIgnore.includes(notify.seq) || notifyTime < this.startupTime) {
16535
+ continue;
16517
16536
  }
16518
- for (const notify of notifies) {
16519
- const notifyTime = Math.trunc(+notify.seq / 1e3 / 1e3);
16520
- if (groupNotifyIgnore.includes(notify.seq) || notifyTime < this.startupTime) {
16521
- continue;
16522
- }
16523
- groupNotifyIgnore.push(notify.seq);
16524
- if (groupNotifyIgnore.length > 1e3) {
16525
- groupNotifyIgnore.shift();
16526
- }
16527
- this.ctx.parallel("nt/group-notify", { notify, doubt });
16537
+ groupNotifyIgnore.push(notify.seq);
16538
+ if (groupNotifyIgnore.length > 1e3) {
16539
+ groupNotifyIgnore.shift();
16528
16540
  }
16541
+ this.ctx.parallel("nt/group-notify", { notify, doubt });
16529
16542
  }
16530
16543
  });
16531
16544
  registerReceiveHook(ReceiveCmdS.FRIEND_REQUEST, (payload) => {
@@ -16860,9 +16873,10 @@ class OB11GroupRequestAddEvent extends OB11BaseNoticeEvent {
16860
16873
  post_type = EventType.REQUEST;
16861
16874
  request_type = "group";
16862
16875
  sub_type;
16876
+ group_id;
16877
+ user_id;
16863
16878
  comment;
16864
16879
  flag;
16865
- group_id;
16866
16880
  // 当有 invitor_id 时表示有邀请人
16867
16881
  invitor_id;
16868
16882
  // https://github.com/Mrs4s/go-cqhttp/blob/master/coolq/event.go#L566
@@ -16881,18 +16895,20 @@ class OB11GroupRequestInviteBotEvent extends OB11BaseNoticeEvent {
16881
16895
  request_type = "group";
16882
16896
  sub_type;
16883
16897
  // invite 为邀请 bot 进群
16884
- comment;
16885
- flag;
16886
16898
  group_id;
16887
16899
  user_id;
16888
16900
  // 当 sub_type 为 invite 的时候, user_id 为邀请人的 QQ 号
16889
- constructor(groupId, userId, flag, comment) {
16901
+ comment;
16902
+ flag;
16903
+ source_group_id;
16904
+ constructor(groupId, userId, flag, comment, sourceGroupId) {
16890
16905
  super();
16891
16906
  this.group_id = groupId;
16892
16907
  this.user_id = userId;
16893
16908
  this.comment = comment;
16894
16909
  this.flag = flag;
16895
16910
  this.sub_type = "invite";
16911
+ this.source_group_id = sourceGroupId;
16896
16912
  }
16897
16913
  }
16898
16914
  var OB11Entities;
@@ -17371,7 +17387,7 @@ var OB11Entities;
17371
17387
  id: element.fileElement.fileUuid,
17372
17388
  name: element.fileElement.fileName,
17373
17389
  size: +element.fileElement.fileSize,
17374
- busid: element.fileElement.fileBizId || 0
17390
+ busid: element.fileElement.fileBizId ?? 0
17375
17391
  });
17376
17392
  } else if (element.grayTipElement) {
17377
17393
  const grayTipElement = element.grayTipElement;
@@ -17522,16 +17538,17 @@ var OB11Entities;
17522
17538
  })(OB11Entities || (OB11Entities = {}));
17523
17539
  class OB11FriendRequestEvent extends OB11BaseNoticeEvent {
17524
17540
  post_type = EventType.REQUEST;
17541
+ request_type = "friend";
17525
17542
  user_id;
17526
- request_type;
17527
17543
  comment;
17528
17544
  flag;
17529
- constructor(userId, comment, flag, requestType = "friend") {
17545
+ via;
17546
+ constructor(userId, comment, flag, via) {
17530
17547
  super();
17531
17548
  this.user_id = userId;
17532
17549
  this.comment = comment;
17533
17550
  this.flag = flag;
17534
- this.request_type = requestType;
17551
+ this.via = via;
17535
17552
  }
17536
17553
  }
17537
17554
  class OB11Response {
@@ -33594,6 +33611,7 @@ var SendElement;
33594
33611
  }
33595
33612
  const thumbDir = path__default.dirname(path2.replaceAll("\\", "/").replace(`/Ori/`, `/Thumb/`));
33596
33613
  const thumbFilePath = path__default.join(thumbDir, `${md5}_0.png`);
33614
+ await mkdir(thumbDir, { recursive: true });
33597
33615
  if (diyThumbPath) {
33598
33616
  await copyFile(diyThumbPath, thumbFilePath);
33599
33617
  } else {
@@ -33881,8 +33899,8 @@ async function createSendElements(ctx, messageData, peer, ignoreTypes = []) {
33881
33899
  const res = await SendElement.pic(
33882
33900
  ctx,
33883
33901
  (await handleOb11RichMedia(ctx, segment, deleteAfterSentFiles)).path,
33884
- segment.data.summary || "",
33885
- segment.data.subType || 0,
33902
+ segment.data.summary ?? "",
33903
+ Number(segment.data.subType) || 0,
33886
33904
  segment.data.type === "flash"
33887
33905
  );
33888
33906
  deleteAfterSentFiles.push(res.picElement.sourcePath);
@@ -34622,6 +34640,7 @@ var ActionName = /* @__PURE__ */ ((ActionName2) => {
34622
34640
  ActionName2["SetGroupMsgMask"] = "set_group_msg_mask";
34623
34641
  ActionName2["SetGroupRemark"] = "set_group_remark";
34624
34642
  ActionName2["MoveGroupFile"] = "move_group_file";
34643
+ ActionName2["RenameGroupFile"] = "rename_group_file";
34625
34644
  ActionName2["SetGroupFileForever"] = "set_group_file_forever";
34626
34645
  ActionName2["GetGroupShutList"] = "get_group_shut_list";
34627
34646
  ActionName2["RenameGroupFileFolder"] = "rename_group_file_folder";
@@ -36690,11 +36709,7 @@ class GetProfileLikeMe extends BaseAction {
36690
36709
  }
36691
36710
  const users = ret.info.userLikeInfos[0].voteInfo.userInfos;
36692
36711
  for (const item of users) {
36693
- try {
36694
- item.uin = Number(await this.ctx.ntUserApi.getUinByUid(item.uid)) || 0;
36695
- } catch (e) {
36696
- item.uin = 0;
36697
- }
36712
+ item.uin = Number(await this.ctx.ntUserApi.getUinByUid(item.uid));
36698
36713
  }
36699
36714
  return { users, nextStart: ret.info.start };
36700
36715
  }
@@ -37256,11 +37271,7 @@ class GetProfileLike extends BaseAction {
37256
37271
  }
37257
37272
  const users = ret.info.userLikeInfos[0].favoriteInfo.userInfos;
37258
37273
  for (const item of users) {
37259
- try {
37260
- item.uin = Number(await this.ctx.ntUserApi.getUinByUid(item.uid)) || 0;
37261
- } catch (e) {
37262
- item.uin = 0;
37263
- }
37274
+ item.uin = Number(await this.ctx.ntUserApi.getUinByUid(item.uid));
37264
37275
  }
37265
37276
  return { users, nextStart: ret.info.start };
37266
37277
  }
@@ -37313,6 +37324,23 @@ let MoveGroupFile$1 = class MoveGroupFile extends BaseAction {
37313
37324
  return null;
37314
37325
  }
37315
37326
  };
37327
+ let RenameGroupFile$1 = class RenameGroupFile extends BaseAction {
37328
+ actionName = ActionName.RenameGroupFile;
37329
+ payloadSchema = z$2.object({
37330
+ group_id: z$2.union([Number, String]).required(),
37331
+ file_id: z$2.string().required(),
37332
+ current_parent_directory: z$2.string().required(),
37333
+ new_name: z$2.string().required()
37334
+ });
37335
+ async _handle(payload) {
37336
+ const groupId = payload.group_id.toString();
37337
+ const res = await this.ctx.ntGroupApi.renameGroupFile(groupId, payload.file_id, payload.current_parent_directory, payload.new_name);
37338
+ if (res.renameGroupFileResult.result.retCode !== 0) {
37339
+ throw new Error(res.renameGroupFileResult.result.clientWording);
37340
+ }
37341
+ return null;
37342
+ }
37343
+ };
37316
37344
  class GetGroupShutList extends BaseAction {
37317
37345
  actionName = ActionName.GetGroupShutList;
37318
37346
  payloadSchema = z$2.object({
@@ -37865,6 +37893,7 @@ function initActionMap(adapter) {
37865
37893
  new SetGroupMsgMask(adapter),
37866
37894
  new SetGroupRemark(adapter),
37867
37895
  new MoveGroupFile$1(adapter),
37896
+ new RenameGroupFile$1(adapter),
37868
37897
  new GetGroupShutList(adapter),
37869
37898
  new RenameGroupFileFolder(adapter),
37870
37899
  new GetRecommendFace(adapter),
@@ -38099,10 +38128,14 @@ class OneBot11Adapter extends Service2 {
38099
38128
  this.config = config2;
38100
38129
  this.actionMap = initActionMap(this);
38101
38130
  this.reportOfflineMessage = false;
38131
+ this.reportSelfMessage = false;
38102
38132
  this.connect = config2.connect.map((item) => {
38103
38133
  if (item.reportOfflineMessage) {
38104
38134
  this.reportOfflineMessage = true;
38105
38135
  }
38136
+ if (item.reportSelfMessage) {
38137
+ this.reportSelfMessage = true;
38138
+ }
38106
38139
  if (item.type === "http") {
38107
38140
  return new OB11Http(ctx, {
38108
38141
  ...item,
@@ -38140,6 +38173,7 @@ class OneBot11Adapter extends Service2 {
38140
38173
  connect;
38141
38174
  actionMap;
38142
38175
  reportOfflineMessage;
38176
+ reportSelfMessage;
38143
38177
  dispatch(event) {
38144
38178
  for (const item of this.connect) {
38145
38179
  item.emitEvent(event);
@@ -38158,7 +38192,7 @@ class OneBot11Adapter extends Service2 {
38158
38192
  const requestUin = await this.ctx.ntUserApi.getUinByUid(notify.user1.uid);
38159
38193
  const event = new OB11GroupRequestAddEvent(
38160
38194
  +notify.group.groupCode,
38161
- +requestUin || 0,
38195
+ +requestUin,
38162
38196
  flag,
38163
38197
  notify.postscript
38164
38198
  );
@@ -38169,9 +38203,10 @@ class OneBot11Adapter extends Service2 {
38169
38203
  this.ctx.logger.info("收到邀请我加群通知, 邀请人uin:", userId);
38170
38204
  const event = new OB11GroupRequestInviteBotEvent(
38171
38205
  +notify.group.groupCode,
38172
- +userId || 0,
38206
+ +userId,
38173
38207
  flag,
38174
- notify.postscript
38208
+ notify.postscript,
38209
+ +notify.invitationExt.groupCode
38175
38210
  );
38176
38211
  this.dispatch(event);
38177
38212
  } else if (notify.type === GroupNotifyType.InvitedNeedAdminiStratorPass && notify.status === GroupNotifyStatus.Unhandle) {
@@ -38180,10 +38215,10 @@ class OneBot11Adapter extends Service2 {
38180
38215
  const invitorId = await this.ctx.ntUserApi.getUinByUid(notify.user2.uid);
38181
38216
  const event = new OB11GroupRequestAddEvent(
38182
38217
  +notify.group.groupCode,
38183
- +userId || 0,
38218
+ +userId,
38184
38219
  flag,
38185
38220
  notify.postscript,
38186
- +invitorId || 0
38221
+ +invitorId
38187
38222
  );
38188
38223
  this.dispatch(event);
38189
38224
  }
@@ -38195,6 +38230,9 @@ class OneBot11Adapter extends Service2 {
38195
38230
  if (offline && !this.reportOfflineMessage) {
38196
38231
  return;
38197
38232
  }
38233
+ if (self2 && !this.reportSelfMessage) {
38234
+ return;
38235
+ }
38198
38236
  OB11Entities.message(this.ctx, message).then((msg) => {
38199
38237
  if (!msg) {
38200
38238
  return;
@@ -38270,19 +38308,13 @@ class OneBot11Adapter extends Service2 {
38270
38308
  }).catch((e) => this.ctx.logger.error("handling recall events", e));
38271
38309
  }
38272
38310
  async handleFriendRequest(req) {
38273
- let userId = 0;
38274
- try {
38275
- const requesterUin = await this.ctx.ntUserApi.getUinByUid(req.friendUid);
38276
- userId = +requesterUin;
38277
- } catch (e) {
38278
- this.ctx.logger.error("获取加好友者QQ号失败", e);
38279
- }
38311
+ const uin = await this.ctx.ntUserApi.getUinByUid(req.friendUid);
38280
38312
  const flag = req.friendUid + "|" + req.reqTime;
38281
- const comment = req.extWords;
38282
38313
  const friendRequestEvent = new OB11FriendRequestEvent(
38283
- userId,
38284
- comment,
38285
- flag
38314
+ +uin,
38315
+ req.extWords,
38316
+ flag,
38317
+ req.addSource ?? ""
38286
38318
  );
38287
38319
  this.dispatch(friendRequestEvent);
38288
38320
  }
@@ -38294,10 +38326,14 @@ class OneBot11Adapter extends Service2 {
38294
38326
  }
38295
38327
  if (config2.ob11.enable) {
38296
38328
  this.reportOfflineMessage = false;
38329
+ this.reportSelfMessage = false;
38297
38330
  this.connect = config2.ob11.connect.map((item) => {
38298
38331
  if (item.reportOfflineMessage) {
38299
38332
  this.reportOfflineMessage = true;
38300
38333
  }
38334
+ if (item.reportSelfMessage) {
38335
+ this.reportSelfMessage = true;
38336
+ }
38301
38337
  if (item.type === "http") {
38302
38338
  return new OB11Http(this.ctx, {
38303
38339
  ...item,
@@ -38554,7 +38590,7 @@ class OneBot11Adapter extends Service2 {
38554
38590
  if (msgType === 732 && subType === 16) {
38555
38591
  const notify = Msg.NotifyMessageBody.decode(pushMsg.message.body.msgContent.subarray(7));
38556
38592
  if (notify.field13 === 35) {
38557
- this.ctx.logger.info("群表情回应", notify.reaction.data.body);
38593
+ this.ctx.logger.info("群表情回应", notify.groupCode, notify.reaction.data.body);
38558
38594
  const info = notify.reaction.data.body.info;
38559
38595
  const target = notify.reaction.data.body.target;
38560
38596
  const userId = Number(await this.ctx.ntUserApi.getUinByUid(info.operatorUid));
@@ -39048,6 +39084,7 @@ var require_index = __commonJS({
39048
39084
  Element2.at = createFactory("at", "id");
39049
39085
  Element2.sharp = createFactory("sharp", "id");
39050
39086
  Element2.quote = createFactory("quote", "id");
39087
+ Element2.emoji = createFactory("emoji", "id");
39051
39088
  Element2.image = createAssetFactory("img");
39052
39089
  Element2.img = createAssetFactory("img");
39053
39090
  Element2.video = createAssetFactory("video");
@@ -39085,10 +39122,10 @@ var Methods = {
39085
39122
  "message.delete": Method("deleteMessage", ["channel_id", "message_id"]),
39086
39123
  "message.get": Method("getMessage", ["channel_id", "message_id"]),
39087
39124
  "message.list": Method("getMessageList", ["channel_id", "next", "direction", "limit", "order"]),
39088
- "reaction.create": Method("createReaction", ["channel_id", "message_id", "emoji"]),
39089
- "reaction.delete": Method("deleteReaction", ["channel_id", "message_id", "emoji", "user_id"]),
39090
- "reaction.clear": Method("clearReaction", ["channel_id", "message_id", "emoji"]),
39091
- "reaction.list": Method("getReactionList", ["channel_id", "message_id", "emoji", "next"]),
39125
+ "reaction.create": Method("createReaction", ["channel_id", "message_id", "emoji_id"]),
39126
+ "reaction.delete": Method("deleteReaction", ["channel_id", "message_id", "emoji_id", "user_id"]),
39127
+ "reaction.clear": Method("clearReaction", ["channel_id", "message_id", "emoji_id"]),
39128
+ "reaction.list": Method("getReactionList", ["channel_id", "message_id", "emoji_id", "next"]),
39092
39129
  "upload.create": Method("createUpload", [], true),
39093
39130
  "guild.get": Method("getGuild", ["guild_id"]),
39094
39131
  "guild.list": Method("getGuildList", ["next"]),
@@ -39244,13 +39281,34 @@ const createDirectChannel = async (ctx, payload) => {
39244
39281
  type: Channel.Type.DIRECT
39245
39282
  };
39246
39283
  };
39284
+ const robotUinRanges = [
39285
+ {
39286
+ minUin: "3328144510",
39287
+ maxUin: "3328144510"
39288
+ },
39289
+ {
39290
+ minUin: "2854196301",
39291
+ maxUin: "2854216399"
39292
+ },
39293
+ {
39294
+ minUin: "66600000",
39295
+ maxUin: "66600000"
39296
+ },
39297
+ {
39298
+ minUin: "3889000000",
39299
+ maxUin: "3889999999"
39300
+ },
39301
+ {
39302
+ minUin: "4010000000",
39303
+ maxUin: "4019999999"
39304
+ }
39305
+ ];
39247
39306
  function decodeUser(user) {
39248
39307
  return {
39249
39308
  id: user.uin,
39250
39309
  name: user.nick,
39251
- nick: user.remark || user.nick,
39252
39310
  avatar: `http://q.qlogo.cn/headimg_dl?dst_uin=${user.uin}&spec=640`,
39253
- is_bot: false
39311
+ is_bot: robotUinRanges.some((e) => user.uin >= e.minUin && user.uin <= e.maxUin)
39254
39312
  };
39255
39313
  }
39256
39314
  function decodeGuildChannelId(data) {
@@ -39260,14 +39318,6 @@ function decodeGuildChannelId(data) {
39260
39318
  return [void 0, "private:" + data.peerUin];
39261
39319
  }
39262
39320
  }
39263
- function decodeMessageUser(data) {
39264
- return {
39265
- id: data.senderUin,
39266
- name: data.sendNickName,
39267
- nick: data.sendRemarkName || data.sendNickName,
39268
- avatar: `http://q.qlogo.cn/headimg_dl?dst_uin=${data.senderUin}&spec=640`
39269
- };
39270
- }
39271
39321
  async function decodeElement(ctx, data, quoted = false) {
39272
39322
  const buffer2 = [];
39273
39323
  for (const v of data.elements) {
@@ -39369,15 +39419,20 @@ async function decodeMessage(ctx, data, message = {}) {
39369
39419
  name: data.peerName,
39370
39420
  type: guildId ? Channel.Type.TEXT : Channel.Type.DIRECT
39371
39421
  };
39372
- message.user = decodeMessageUser(data);
39422
+ message.user = {
39423
+ id: data.senderUin,
39424
+ name: data.sendNickName,
39425
+ avatar: `http://q.qlogo.cn/headimg_dl?dst_uin=${data.senderUin}&spec=640`,
39426
+ is_bot: robotUinRanges.some((e) => data.senderUin >= e.minUin && data.senderUin <= e.maxUin)
39427
+ };
39373
39428
  message.created_at = +data.msgTime * 1e3;
39374
39429
  if (!message.user.name) {
39375
- const info = (await ctx.ntUserApi.getUserSimpleInfo(data.senderUid)).coreInfo;
39376
- message.user.name = info.nick;
39377
- message.user.nick = info.remark || info.nick;
39378
- if (message.channel.type === Channel.Type.DIRECT) {
39379
- message.channel.name = info.nick;
39380
- }
39430
+ const { coreInfo } = await ctx.ntUserApi.getUserSimpleInfo(data.senderUid);
39431
+ message.user.name = coreInfo.nick;
39432
+ }
39433
+ if (!message.channel.name && message.channel.type === Channel.Type.DIRECT) {
39434
+ const { coreInfo } = await ctx.ntUserApi.getUserSimpleInfo(data.peerUid);
39435
+ message.channel.name = coreInfo.nick;
39381
39436
  }
39382
39437
  if (guildId) {
39383
39438
  message.guild = {
@@ -39387,20 +39442,25 @@ async function decodeMessage(ctx, data, message = {}) {
39387
39442
  };
39388
39443
  message.member = {
39389
39444
  user: message.user,
39390
- nick: data.sendMemberName || message.user.name
39445
+ nick: data.sendMemberName
39391
39446
  };
39392
39447
  }
39393
39448
  return message;
39394
39449
  }
39395
39450
  function decodeGuildMember(data) {
39396
39451
  return {
39397
- user: {
39398
- ...decodeUser(data),
39399
- is_bot: data.isRobot
39400
- },
39452
+ user: decodeUser(data),
39401
39453
  nick: data.cardName || data.nick,
39402
39454
  avatar: `http://q.qlogo.cn/headimg_dl?dst_uin=${data.uin}&spec=640`,
39403
- joined_at: data.joinTime * 1e3
39455
+ joined_at: data.joinTime * 1e3,
39456
+ roles: [{
39457
+ id: data.role.toString(),
39458
+ name: {
39459
+ 4: "owner",
39460
+ 3: "admin",
39461
+ 2: "member"
39462
+ }[data.role]
39463
+ }]
39404
39464
  };
39405
39465
  }
39406
39466
  function decodeGuild(data) {
@@ -39891,7 +39951,7 @@ const createReaction = async (ctx, payload) => {
39891
39951
  if (!msgList.length) {
39892
39952
  throw new Error("无法获取该消息");
39893
39953
  }
39894
- const res = await ctx.ntMsgApi.setEmojiLike(peer, msgList[0].msgSeq, payload.emoji, true);
39954
+ const res = await ctx.ntMsgApi.setEmojiLike(peer, msgList[0].msgSeq, payload.emoji_id, true);
39895
39955
  if (res.result !== 0) {
39896
39956
  throw new Error(res.errMsg);
39897
39957
  }
@@ -39903,8 +39963,7 @@ const deleteReaction = async (ctx, payload) => {
39903
39963
  if (!msgList.length) {
39904
39964
  throw new Error("无法获取该消息");
39905
39965
  }
39906
- await ctx.ntMsgApi.setEmojiLike(peer, msgList[0].msgSeq, payload.emoji, false);
39907
- const res = await ctx.ntMsgApi.setEmojiLike(peer, msgList[0].msgSeq, payload.emoji, false);
39966
+ const res = await ctx.ntMsgApi.setEmojiLike(peer, msgList[0].msgSeq, payload.emoji_id, false);
39908
39967
  if (res.result !== 0) {
39909
39968
  throw new Error(res.errMsg);
39910
39969
  }
@@ -39916,8 +39975,8 @@ const getReactionList = async (ctx, payload) => {
39916
39975
  if (!msgList.length) {
39917
39976
  throw new Error("无法获取该消息");
39918
39977
  }
39919
- const count = msgList[0].emojiLikesList.find((e) => e.emojiId === payload.emoji)?.likesCnt ?? "50";
39920
- const data = await ctx.ntMsgApi.getMsgEmojiLikesList(peer, msgList[0].msgSeq, payload.emoji, +count);
39978
+ const count = msgList[0].emojiLikesList.find((e) => e.emojiId === payload.emoji_id)?.likesCnt ?? "50";
39979
+ const data = await ctx.ntMsgApi.getMsgEmojiLikesList(peer, msgList[0].msgSeq, payload.emoji_id, +count);
39921
39980
  if (data.result !== 0) {
39922
39981
  throw new Error(data.errMsg);
39923
39982
  }
@@ -39964,19 +40023,15 @@ const getUser = async (ctx, payload) => {
39964
40023
  const uid = await ctx.ntUserApi.getUidByUin(uin);
39965
40024
  if (!uid) throw new Error("无法获取用户信息");
39966
40025
  const data = await ctx.ntUserApi.getUserSimpleInfo(uid, true);
39967
- const range2 = await ctx.ntUserApi.getRobotUinRange();
39968
- if (range2.result !== 0) {
39969
- throw new Error(range2.errMsg);
39970
- }
39971
- return {
39972
- ...decodeUser(data.coreInfo),
39973
- is_bot: range2.response.robotUinRanges.some((e) => uin >= e.minUin && uin <= e.maxUin)
39974
- };
40026
+ return decodeUser(data.coreInfo);
39975
40027
  };
39976
40028
  const getFriendList = async (ctx) => {
39977
40029
  const friends = await ctx.ntFriendApi.getBuddyList();
39978
40030
  return {
39979
- data: friends.map((e) => decodeUser(e.coreInfo))
40031
+ data: friends.map((e) => ({
40032
+ user: decodeUser(e.coreInfo),
40033
+ nick: e.coreInfo.remark
40034
+ }))
39980
40035
  };
39981
40036
  };
39982
40037
  const handleFriendRequest = async (ctx, payload) => {
@@ -39992,6 +40047,15 @@ const handleFriendRequest = async (ctx, payload) => {
39992
40047
  }
39993
40048
  return {};
39994
40049
  };
40050
+ const deleteFriend = async (ctx, payload) => {
40051
+ const uid = await ctx.ntUserApi.getUidByUin(payload.user_id);
40052
+ if (!uid) throw new Error("无法获取用户信息");
40053
+ const res = await ctx.ntFriendApi.delBuddy(uid);
40054
+ if (res.result !== 0) {
40055
+ throw new Error(res.errMsg);
40056
+ }
40057
+ return {};
40058
+ };
39995
40059
  const handlers = {
39996
40060
  // 频道 (Channel)
39997
40061
  getChannel,
@@ -40026,8 +40090,10 @@ const handlers = {
40026
40090
  getGuildRoleList,
40027
40091
  // 用户 (User)
40028
40092
  getUser,
40093
+ // 好友 (Friend)
40029
40094
  getFriendList,
40030
- handleFriendRequest
40095
+ handleFriendRequest,
40096
+ deleteFriend
40031
40097
  };
40032
40098
  class SatoriServer {
40033
40099
  constructor(ctx, config2) {
@@ -40243,7 +40309,7 @@ async function parseGuildRequest(bot, notify) {
40243
40309
  }
40244
40310
  });
40245
40311
  }
40246
- async function parseGuildMemberAdded(bot, input, isBot = false) {
40312
+ async function parseGuildMemberAdded(bot, input) {
40247
40313
  const groupAll = await bot.ctx.ntGroupApi.getGroupAllInfo(input.peerUid);
40248
40314
  let memberUid;
40249
40315
  if (input.elements[0].grayTipElement?.groupElement) {
@@ -40260,13 +40326,12 @@ async function parseGuildMemberAdded(bot, input, isBot = false) {
40260
40326
  }
40261
40327
  if (!memberUid) return;
40262
40328
  const user = decodeUser((await bot.ctx.ntUserApi.getUserSimpleInfo(memberUid)).coreInfo);
40263
- user.is_bot = isBot;
40264
40329
  return bot.event("guild-member-added", {
40265
40330
  guild: decodeGuild(groupAll),
40266
40331
  user,
40267
40332
  member: {
40268
40333
  user,
40269
- nick: user.name
40334
+ nick: ""
40270
40335
  }
40271
40336
  });
40272
40337
  }
@@ -40277,7 +40342,7 @@ async function parseGuildMemberRemoved(bot, input) {
40277
40342
  user,
40278
40343
  member: {
40279
40344
  user,
40280
- nick: user.name
40345
+ nick: ""
40281
40346
  }
40282
40347
  });
40283
40348
  }
@@ -40303,7 +40368,7 @@ async function parseFriendRequest(bot, input) {
40303
40368
  }
40304
40369
  });
40305
40370
  }
40306
- async function parseReactionAdded(bot, input, time2) {
40371
+ async function parseReactionAdded(bot, input) {
40307
40372
  const { info, target } = input.reaction.data.body;
40308
40373
  const peer = {
40309
40374
  chatType: ChatType.Group,
@@ -40319,9 +40384,7 @@ async function parseReactionAdded(bot, input, time2) {
40319
40384
  const groupAll = await bot.ctx.ntGroupApi.getGroupAllInfo(input.groupCode.toString());
40320
40385
  return bot.event("reaction-added", {
40321
40386
  message: {
40322
- id: targetMsg.msgList[0].msgId,
40323
- content: info.code,
40324
- timestamp: time2 * 1e3
40387
+ id: targetMsg.msgList[0].msgId
40325
40388
  },
40326
40389
  user: decodeUser(user.coreInfo),
40327
40390
  channel: {
@@ -40329,10 +40392,13 @@ async function parseReactionAdded(bot, input, time2) {
40329
40392
  name: groupAll.groupName,
40330
40393
  type: Channel.Type.TEXT
40331
40394
  },
40332
- guild: decodeGuild(groupAll)
40395
+ guild: decodeGuild(groupAll),
40396
+ emoji: {
40397
+ id: info.code
40398
+ }
40333
40399
  });
40334
40400
  }
40335
- async function parseReactionRemoved(bot, input, time2) {
40401
+ async function parseReactionRemoved(bot, input) {
40336
40402
  const { info, target } = input.reaction.data.body;
40337
40403
  const peer = {
40338
40404
  chatType: ChatType.Group,
@@ -40348,9 +40414,7 @@ async function parseReactionRemoved(bot, input, time2) {
40348
40414
  const groupAll = await bot.ctx.ntGroupApi.getGroupAllInfo(input.groupCode.toString());
40349
40415
  return bot.event("reaction-removed", {
40350
40416
  message: {
40351
- id: targetMsg.msgList[0].msgId,
40352
- content: info.code,
40353
- timestamp: time2 * 1e3
40417
+ id: targetMsg.msgList[0].msgId
40354
40418
  },
40355
40419
  user: decodeUser(user.coreInfo),
40356
40420
  channel: {
@@ -40358,7 +40422,10 @@ async function parseReactionRemoved(bot, input, time2) {
40358
40422
  name: groupAll.groupName,
40359
40423
  type: Channel.Type.TEXT
40360
40424
  },
40361
- guild: decodeGuild(groupAll)
40425
+ guild: decodeGuild(groupAll),
40426
+ emoji: {
40427
+ id: info.code
40428
+ }
40362
40429
  });
40363
40430
  }
40364
40431
  class SatoriAdapter extends Service2 {
@@ -40399,7 +40466,7 @@ class SatoriAdapter extends Service2 {
40399
40466
  } else if (input.msgType === 5 && input.subMsgType === 12 && input.elements[0]?.grayTipElement?.xmlElement?.templId === "10179") {
40400
40467
  return await parseGuildMemberAdded(this, input);
40401
40468
  } else if (input.msgType === 5 && input.subMsgType === 12 && input.elements[0]?.grayTipElement?.jsonGrayTipElement?.busiId === "19217") {
40402
- return await parseGuildMemberAdded(this, input, true);
40469
+ return await parseGuildMemberAdded(this, input);
40403
40470
  } else if (input.msgType === 5 && input.subMsgType === 12 && input.elements[0]?.grayTipElement?.xmlElement?.templId === "10382") ;
40404
40471
  else {
40405
40472
  return await parseMessageCreated(this, input);
@@ -40471,17 +40538,17 @@ class SatoriAdapter extends Service2 {
40471
40538
  if (!pushMsg.message.body) {
40472
40539
  return;
40473
40540
  }
40474
- const { msgTime, msgType, subType } = pushMsg.message.contentHead;
40541
+ const { msgType, subType } = pushMsg.message.contentHead;
40475
40542
  if (msgType === 732 && subType === 16) {
40476
40543
  const notify = Msg.NotifyMessageBody.decode(pushMsg.message.body.msgContent.subarray(7));
40477
40544
  if (notify.field13 === 35) {
40478
40545
  if (notify.reaction.data.body.info.actionType === 1) {
40479
- const event = await parseReactionAdded(this, notify, msgTime).catch((e) => this.ctx.logger.error(e));
40546
+ const event = await parseReactionAdded(this, notify).catch((e) => this.ctx.logger.error(e));
40480
40547
  if (event) {
40481
40548
  this.server.dispatch(event);
40482
40549
  }
40483
40550
  } else {
40484
- const event = await parseReactionRemoved(this, notify, msgTime).catch((e) => this.ctx.logger.error(e));
40551
+ const event = await parseReactionRemoved(this, notify).catch((e) => this.ctx.logger.error(e));
40485
40552
  if (event) {
40486
40553
  this.server.dispatch(event);
40487
40554
  }
@@ -54874,7 +54941,8 @@ const GroupInvitedJoinRequestEvent = object({
54874
54941
  const GroupInvitationEvent = object({
54875
54942
  group_id: ZUin.describe("群号"),
54876
54943
  invitation_seq: ZInt64.describe("邀请序列号"),
54877
- initiator_id: ZUin.describe("邀请者 QQ 号")
54944
+ initiator_id: ZUin.describe("邀请者 QQ 号"),
54945
+ source_group_id: ZUin.nullish().describe("来源群号,如果是通过 QQ 群邀请")
54878
54946
  });
54879
54947
  const FriendNudgeEvent = object({
54880
54948
  user_id: ZUin.describe("好友 QQ 号"),
@@ -55076,7 +55144,7 @@ discriminatedUnion("event_type", [
55076
55144
  data: GroupFileUploadEvent
55077
55145
  }).describe("群文件上传事件")
55078
55146
  ]).describe("事件");
55079
- var version$1 = "1.2.0-rc.2";
55147
+ var version$1 = "1.2.0-rc.3";
55080
55148
  const milkyPackageVersion = version$1;
55081
55149
  const milkyVersion = milkyPackageVersion.split(".").slice(0, 2).join(".");
55082
55150
  const CachedApiBase = object({ no_cache: ZBooleanWithDefault(false).describe("是否强制不使用缓存") });
@@ -55831,7 +55899,7 @@ async function transformOutgoingMessage(ctx, segments2, peerUid, isGroup = false
55831
55899
  peerUid,
55832
55900
  guildId: ""
55833
55901
  };
55834
- const source2 = await ctx.ntMsgApi.getMsgsBySeqAndCount(peer, replyMsgSeq, 1, true, true);
55902
+ const source2 = await ctx.ntMsgApi.getSingleMsg(peer, replyMsgSeq);
55835
55903
  if (source2.msgList.length === 0) {
55836
55904
  throw new Error("被回复的消息未找到");
55837
55905
  }
@@ -56426,7 +56494,7 @@ function validateAttributeString(attrStr, options) {
56426
56494
  if (!validateAttrName(attrName)) {
56427
56495
  return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is an invalid name.", getPositionFromMatch(matches[i]));
56428
56496
  }
56429
- if (!attrNames.hasOwnProperty(attrName)) {
56497
+ if (!Object.prototype.hasOwnProperty.call(attrNames, attrName)) {
56430
56498
  attrNames[attrName] = 1;
56431
56499
  } else {
56432
56500
  return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is repeated.", getPositionFromMatch(matches[i]));
@@ -56536,7 +56604,9 @@ const defaultOptions = {
56536
56604
  return tagName;
56537
56605
  },
56538
56606
  // skipEmptyListItem: false
56539
- captureMetaData: false
56607
+ captureMetaData: false,
56608
+ maxNestedTags: 100,
56609
+ strictReservedNames: true
56540
56610
  };
56541
56611
  function normalizeProcessEntities(value) {
56542
56612
  if (typeof value === "boolean") {
@@ -56547,6 +56617,7 @@ function normalizeProcessEntities(value) {
56547
56617
  maxExpansionDepth: 10,
56548
56618
  maxTotalExpansions: 1e3,
56549
56619
  maxExpandedLength: 1e5,
56620
+ maxEntityCount: 100,
56550
56621
  allowedTags: null,
56551
56622
  tagFilter: null
56552
56623
  };
@@ -56559,6 +56630,7 @@ function normalizeProcessEntities(value) {
56559
56630
  maxExpansionDepth: value.maxExpansionDepth ?? 10,
56560
56631
  maxTotalExpansions: value.maxTotalExpansions ?? 1e3,
56561
56632
  maxExpandedLength: value.maxExpandedLength ?? 1e5,
56633
+ maxEntityCount: value.maxEntityCount ?? 100,
56562
56634
  allowedTags: value.allowedTags ?? null,
56563
56635
  tagFilter: value.tagFilter ?? null
56564
56636
  };
@@ -56580,7 +56652,7 @@ class XmlNode {
56580
56652
  constructor(tagname) {
56581
56653
  this.tagname = tagname;
56582
56654
  this.child = [];
56583
- this[":@"] = {};
56655
+ this[":@"] = /* @__PURE__ */ Object.create(null);
56584
56656
  }
56585
56657
  add(key2, val) {
56586
56658
  if (key2 === "__proto__") key2 = "#__proto__";
@@ -56608,7 +56680,8 @@ class DocTypeReader {
56608
56680
  this.options = options;
56609
56681
  }
56610
56682
  readDocType(xmlData, i) {
56611
- const entities = {};
56683
+ const entities = /* @__PURE__ */ Object.create(null);
56684
+ let entityCount = 0;
56612
56685
  if (xmlData[i + 3] === "O" && xmlData[i + 4] === "C" && xmlData[i + 5] === "T" && xmlData[i + 6] === "Y" && xmlData[i + 7] === "P" && xmlData[i + 8] === "E") {
56613
56686
  i = i + 9;
56614
56687
  let angleBracketsCount = 1;
@@ -56621,11 +56694,17 @@ class DocTypeReader {
56621
56694
  let entityName, val;
56622
56695
  [entityName, val, i] = this.readEntityExp(xmlData, i + 1, this.suppressValidationErr);
56623
56696
  if (val.indexOf("&") === -1) {
56697
+ if (this.options.enabled !== false && this.options.maxEntityCount && entityCount >= this.options.maxEntityCount) {
56698
+ throw new Error(
56699
+ `Entity count (${entityCount + 1}) exceeds maximum allowed (${this.options.maxEntityCount})`
56700
+ );
56701
+ }
56624
56702
  const escaped = entityName.replace(/[.\-+*:]/g, "\\.");
56625
56703
  entities[entityName] = {
56626
56704
  regx: RegExp(`&${escaped};`, "g"),
56627
56705
  val
56628
56706
  };
56707
+ entityCount++;
56629
56708
  }
56630
56709
  } else if (hasBody && hasSeq(xmlData, "!ELEMENT", i)) {
56631
56710
  i += 8;
@@ -56877,8 +56956,10 @@ const consider = {
56877
56956
  // oct: false,
56878
56957
  leadingZeros: true,
56879
56958
  decimalPoint: ".",
56880
- eNotation: true
56881
- //skipLike: /regex/
56959
+ eNotation: true,
56960
+ //skipLike: /regex/,
56961
+ infinity: "original"
56962
+ // "null", "infinity" (Infinity type), "string" ("Infinity" (the string literal))
56882
56963
  };
56883
56964
  function toNumber(str, options = {}) {
56884
56965
  options = Object.assign({}, consider, options);
@@ -56888,6 +56969,8 @@ function toNumber(str, options = {}) {
56888
56969
  else if (str === "0") return 0;
56889
56970
  else if (options.hex && hexRegex.test(trimmedStr)) {
56890
56971
  return parse_int(trimmedStr, 16);
56972
+ } else if (!isFinite(trimmedStr)) {
56973
+ return handleInfinity(str, Number(trimmedStr), options);
56891
56974
  } else if (trimmedStr.includes("e") || trimmedStr.includes("E")) {
56892
56975
  return resolveEnotation(str, trimmedStr, options);
56893
56976
  } else {
@@ -56966,6 +57049,21 @@ function parse_int(numStr, base) {
56966
57049
  else if (window && window.parseInt) return window.parseInt(numStr, base);
56967
57050
  else throw new Error("parseInt, Number.parseInt, window.parseInt are not supported");
56968
57051
  }
57052
+ function handleInfinity(str, num, options) {
57053
+ const isPositive = num === Infinity;
57054
+ switch (options.infinity.toLowerCase()) {
57055
+ case "null":
57056
+ return null;
57057
+ case "infinity":
57058
+ return num;
57059
+ // Return Infinity or -Infinity
57060
+ case "string":
57061
+ return isPositive ? "Infinity" : "-Infinity";
57062
+ case "original":
57063
+ default:
57064
+ return str;
57065
+ }
57066
+ }
56969
57067
  function getIgnoreAttributesFn(ignoreAttributes) {
56970
57068
  if (typeof ignoreAttributes === "function") {
56971
57069
  return ignoreAttributes;
@@ -57236,6 +57334,9 @@ const parseXml = function(xmlData) {
57236
57334
  }
57237
57335
  tagName = newTagName;
57238
57336
  }
57337
+ if (this.options.strictReservedNames && (tagName === this.options.commentPropName || tagName === this.options.cdataPropName)) {
57338
+ throw new Error(`Invalid tag name: ${tagName}`);
57339
+ }
57239
57340
  if (currentNode && textData) {
57240
57341
  if (currentNode.tagname !== "!xml") {
57241
57342
  textData = this.saveTextToParentTag(textData, currentNode, jPath, false);
@@ -57301,8 +57402,20 @@ const parseXml = function(xmlData) {
57301
57402
  }
57302
57403
  this.addChild(currentNode, childNode, jPath, startIndex);
57303
57404
  jPath = jPath.substr(0, jPath.lastIndexOf("."));
57405
+ } else if (this.options.unpairedTags.indexOf(tagName) !== -1) {
57406
+ const childNode = new XmlNode(tagName);
57407
+ if (tagName !== tagExp && attrExpPresent) {
57408
+ childNode[":@"] = this.buildAttributesMap(tagExp, jPath);
57409
+ }
57410
+ this.addChild(currentNode, childNode, jPath, startIndex);
57411
+ jPath = jPath.substr(0, jPath.lastIndexOf("."));
57412
+ i = result.closeIndex;
57413
+ continue;
57304
57414
  } else {
57305
57415
  const childNode = new XmlNode(tagName);
57416
+ if (this.tagsNodeStack.length > this.options.maxNestedTags) {
57417
+ throw new Error("Maximum nested tags exceeded");
57418
+ }
57306
57419
  this.tagsNodeStack.push(currentNode);
57307
57420
  if (tagName !== tagExp && attrExpPresent) {
57308
57421
  childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName);
@@ -57386,19 +57499,19 @@ const replaceEntitiesValue = function(val, tagName, jPath) {
57386
57499
  val = val.replace(this.ampEntity.regex, this.ampEntity.val);
57387
57500
  return val;
57388
57501
  };
57389
- function saveTextToParentTag(textData, currentNode, jPath, isLeafNode) {
57502
+ function saveTextToParentTag(textData, parentNode, jPath, isLeafNode) {
57390
57503
  if (textData) {
57391
- if (isLeafNode === void 0) isLeafNode = currentNode.child.length === 0;
57504
+ if (isLeafNode === void 0) isLeafNode = parentNode.child.length === 0;
57392
57505
  textData = this.parseTextData(
57393
57506
  textData,
57394
- currentNode.tagname,
57507
+ parentNode.tagname,
57395
57508
  jPath,
57396
57509
  false,
57397
- currentNode[":@"] ? Object.keys(currentNode[":@"]).length !== 0 : false,
57510
+ parentNode[":@"] ? Object.keys(parentNode[":@"]).length !== 0 : false,
57398
57511
  isLeafNode
57399
57512
  );
57400
57513
  if (textData !== void 0 && textData !== "")
57401
- currentNode.add(this.options.textNodeName, textData);
57514
+ parentNode.add(this.options.textNodeName, textData);
57402
57515
  textData = "";
57403
57516
  }
57404
57517
  return textData;
@@ -57556,9 +57669,6 @@ function compress(arr, options, jPath) {
57556
57669
  } else if (tagObj[property]) {
57557
57670
  let val = compress(tagObj[property], options, newJpath);
57558
57671
  const isLeaf = isLeafTag(val, options);
57559
- if (tagObj[METADATA_SYMBOL] !== void 0) {
57560
- val[METADATA_SYMBOL] = tagObj[METADATA_SYMBOL];
57561
- }
57562
57672
  if (tagObj[":@"]) {
57563
57673
  assignAttributes(val, tagObj[":@"], newJpath, options);
57564
57674
  } else if (Object.keys(val).length === 1 && val[options.textNodeName] !== void 0 && !options.alwaysCreateTextNode) {
@@ -57567,7 +57677,10 @@ function compress(arr, options, jPath) {
57567
57677
  if (options.alwaysCreateTextNode) val[options.textNodeName] = "";
57568
57678
  else val = "";
57569
57679
  }
57570
- if (compressedObj[property] !== void 0 && compressedObj.hasOwnProperty(property)) {
57680
+ if (tagObj[METADATA_SYMBOL] !== void 0 && typeof val === "object" && val !== null) {
57681
+ val[METADATA_SYMBOL] = tagObj[METADATA_SYMBOL];
57682
+ }
57683
+ if (compressedObj[property] !== void 0 && Object.prototype.hasOwnProperty.call(compressedObj, property)) {
57571
57684
  if (!Array.isArray(compressedObj[property])) {
57572
57685
  compressedObj[property] = [compressedObj[property]];
57573
57686
  }
@@ -58170,21 +58283,21 @@ const GetMessage = defineApi(
58170
58283
  async (ctx, payload) => {
58171
58284
  const peer = {
58172
58285
  chatType: {
58173
- friend: 1,
58174
- group: 2,
58175
- temp: 100
58286
+ friend: ChatType.C2C,
58287
+ group: ChatType.Group,
58288
+ temp: ChatType.TempC2CFromGroup
58176
58289
  }[payload.message_scene],
58177
58290
  peerUid: payload.peer_id.toString(),
58178
58291
  guildId: ""
58179
58292
  };
58180
- if (peer.chatType === 1 || peer.chatType === 100) {
58293
+ if (peer.chatType === ChatType.C2C || peer.chatType === ChatType.TempC2CFromGroup) {
58181
58294
  const uid = await ctx.ntUserApi.getUidByUin(peer.peerUid);
58182
58295
  if (!uid) {
58183
58296
  return Failed(-404, "User not found");
58184
58297
  }
58185
58298
  peer.peerUid = uid;
58186
58299
  }
58187
- const msgResult = await ctx.ntMsgApi.queryFirstMsgBySeq(peer, payload.message_seq.toString());
58300
+ const msgResult = await ctx.ntMsgApi.getSingleMsg(peer, payload.message_seq.toString());
58188
58301
  if (msgResult.msgList.length === 0) {
58189
58302
  return Failed(-404, "Message not found");
58190
58303
  }
@@ -58431,21 +58544,6 @@ const GetFriendRequests = defineApi(
58431
58544
  requests: await Promise.all(buddyReqs.map(async (e) => {
58432
58545
  const friendId = Number(await ctx.ntUserApi.getUinByUid(e.friendUid));
58433
58546
  const selfId = Number(selfInfo.uin);
58434
- let via = "";
58435
- if (e.sourceId === 3020) {
58436
- via = "QQ号查找";
58437
- } else if (e.sourceId === 3004) {
58438
- const groupAll = await ctx.ntGroupApi.getGroupAllInfo(e.groupCode);
58439
- via = `QQ群-${groupAll.groupName}`;
58440
- } else if (e.sourceId === 3014) {
58441
- via = "手机号码查找";
58442
- } else if (e.sourceId === 3999) {
58443
- via = "搜索好友";
58444
- } else if (e.sourceId === 3022) {
58445
- via = "推荐联系人";
58446
- } else if (e.sourceId > 10) {
58447
- ctx.logger.info(`via 获取失败, 请反馈, friendId: ${friendId}, sourceId: ${e.sourceId}`);
58448
- }
58449
58547
  return {
58450
58548
  time: Number(e.reqTime),
58451
58549
  initiator_id: e.isInitiator ? selfId : friendId,
@@ -58461,7 +58559,7 @@ const GetFriendRequests = defineApi(
58461
58559
  [BuddyReqType.MeRefused]: "rejected"
58462
58560
  }[e.reqType] ?? "pending",
58463
58561
  comment: e.extWords,
58464
- via,
58562
+ via: e.addSource ?? "",
58465
58563
  is_filtered: e.isDoubt
58466
58564
  };
58467
58565
  }))
@@ -59148,7 +59246,7 @@ const MoveGroupFile2 = defineApi(
59148
59246
  return Ok({});
59149
59247
  }
59150
59248
  );
59151
- const RenameGroupFile = defineApi(
59249
+ const RenameGroupFile2 = defineApi(
59152
59250
  "rename_group_file",
59153
59251
  RenameGroupFileInput,
59154
59252
  z.object({}),
@@ -59235,7 +59333,7 @@ const FileApi = [
59235
59333
  GetGroupFileDownloadUrl,
59236
59334
  GetGroupFiles,
59237
59335
  MoveGroupFile2,
59238
- RenameGroupFile,
59336
+ RenameGroupFile2,
59239
59337
  DeleteGroupFile2,
59240
59338
  CreateGroupFolder,
59241
59339
  RenameGroupFolder,
@@ -59321,26 +59419,11 @@ async function transformGroupMessageDeleted(ctx, message) {
59321
59419
  async function transformFriendRequestEvent(ctx, request2) {
59322
59420
  try {
59323
59421
  const initiatorId = Number(await ctx.ntUserApi.getUinByUid(request2.friendUid));
59324
- let via = "";
59325
- if (request2.sourceId === 3020) {
59326
- via = "QQ号查找";
59327
- } else if (request2.sourceId === 3004) {
59328
- const groupAll = await ctx.ntGroupApi.getGroupAllInfo(request2.groupCode);
59329
- via = `QQ群-${groupAll.groupName}`;
59330
- } else if (request2.sourceId === 3014) {
59331
- via = "手机号码查找";
59332
- } else if (request2.sourceId === 3999) {
59333
- via = "搜索好友";
59334
- } else if (request2.sourceId === 3022) {
59335
- via = "推荐联系人";
59336
- } else if (request2.sourceId > 10) {
59337
- ctx.logger.info(`via 获取失败, 请反馈, friendId: ${initiatorId}, sourceId: ${request2.sourceId}`);
59338
- }
59339
59422
  return {
59340
59423
  initiator_id: initiatorId,
59341
59424
  initiator_uid: request2.friendUid,
59342
59425
  comment: request2.extWords,
59343
- via
59426
+ via: request2.addSource ?? ""
59344
59427
  };
59345
59428
  } catch (error2) {
59346
59429
  ctx.logger.error("Failed to transform friend request event:", error2);
@@ -59376,7 +59459,8 @@ async function transformGroupNotify(ctx, notify, doubt) {
59376
59459
  data: {
59377
59460
  group_id: Number(notify.group.groupCode),
59378
59461
  invitation_seq: Number(notify.seq),
59379
- initiator_id: Number(await ctx.ntUserApi.getUinByUid(notify.user2.uid))
59462
+ initiator_id: Number(await ctx.ntUserApi.getUinByUid(notify.user2.uid)),
59463
+ source_group_id: Number(notify.invitationExt.groupCode)
59380
59464
  }
59381
59465
  };
59382
59466
  } else {
@@ -72004,27 +72088,6 @@ function requireLib() {
72004
72088
  };
72005
72089
  return lib;
72006
72090
  }
72007
- var immutable;
72008
- var hasRequiredImmutable;
72009
- function requireImmutable() {
72010
- if (hasRequiredImmutable) return immutable;
72011
- hasRequiredImmutable = 1;
72012
- immutable = extend2;
72013
- var hasOwnProperty = Object.prototype.hasOwnProperty;
72014
- function extend2() {
72015
- var target = {};
72016
- for (var i = 0; i < arguments.length; i++) {
72017
- var source2 = arguments[i];
72018
- for (var key2 in source2) {
72019
- if (hasOwnProperty.call(source2, key2)) {
72020
- target[key2] = source2[key2];
72021
- }
72022
- }
72023
- }
72024
- return target;
72025
- }
72026
- return immutable;
72027
- }
72028
72091
  var parsePath_1;
72029
72092
  var hasRequiredParsePath;
72030
72093
  function requireParsePath() {
@@ -72214,7 +72277,6 @@ var hasRequiredFileAppender;
72214
72277
  function requireFileAppender() {
72215
72278
  if (hasRequiredFileAppender) return fileAppender;
72216
72279
  hasRequiredFileAppender = 1;
72217
- var objectAssign2 = requireObjectAssign();
72218
72280
  function arrayRemove(arr, item) {
72219
72281
  var idx = arr.indexOf(item);
72220
72282
  if (~idx) arr.splice(idx, 1);
@@ -72283,7 +72345,7 @@ function requireFileAppender() {
72283
72345
  return;
72284
72346
  }
72285
72347
  delete placeholder.fieldname;
72286
- objectAssign2(placeholder, file2);
72348
+ Object.assign(placeholder, file2);
72287
72349
  };
72288
72350
  fileAppender = FileAppender;
72289
72351
  return fileAppender;
@@ -72306,7 +72368,9 @@ function requireRemoveUploadedFiles() {
72306
72368
  errors2.push(err);
72307
72369
  }
72308
72370
  if (idx < length - 1) {
72309
- handleFile(idx + 1);
72371
+ setImmediate(function() {
72372
+ handleFile(idx + 1);
72373
+ });
72310
72374
  } else {
72311
72375
  cb(null, errors2);
72312
72376
  }
@@ -72324,7 +72388,6 @@ function requireMakeMiddleware() {
72324
72388
  hasRequiredMakeMiddleware = 1;
72325
72389
  var is2 = requireTypeIs();
72326
72390
  var Busboy = requireLib();
72327
- var extend2 = requireImmutable();
72328
72391
  var appendField = requireAppendField();
72329
72392
  var Counter = requireCounter();
72330
72393
  var MulterError = requireMulterError();
@@ -72345,40 +72408,47 @@ function requireMakeMiddleware() {
72345
72408
  var fileFilter = options.fileFilter;
72346
72409
  var fileStrategy = options.fileStrategy;
72347
72410
  var preservePath = options.preservePath;
72411
+ var defParamCharset = options.defParamCharset;
72348
72412
  req.body = /* @__PURE__ */ Object.create(null);
72349
- req.on("error", function(err) {
72350
- abortWithError(err);
72351
- });
72352
72413
  var busboy;
72353
- try {
72354
- busboy = Busboy({ headers: req.headers, limits, preservePath });
72355
- } catch (err) {
72356
- return next(err);
72357
- }
72358
- var appender = new FileAppender(fileStrategy, req);
72414
+ var appender = null;
72359
72415
  var isDone = false;
72360
72416
  var readFinished = false;
72361
72417
  var errorOccured = false;
72362
72418
  var pendingWrites = new Counter();
72363
72419
  var uploadedFiles = [];
72364
72420
  function done(err) {
72421
+ var called = false;
72422
+ function onFinished2() {
72423
+ if (called) return;
72424
+ called = true;
72425
+ next(err);
72426
+ }
72365
72427
  if (isDone) return;
72366
72428
  isDone = true;
72367
- req.unpipe(busboy);
72429
+ if (busboy) {
72430
+ req.unpipe(busboy);
72431
+ setImmediate(() => {
72432
+ busboy.removeAllListeners();
72433
+ });
72434
+ }
72368
72435
  drainStream(req);
72369
72436
  req.resume();
72370
- setImmediate(() => {
72371
- busboy.removeAllListeners();
72372
- });
72437
+ if (err && req.readable && !req.destroyed) {
72438
+ req.once("end", onFinished2);
72439
+ req.once("error", onFinished2);
72440
+ req.once("close", onFinished2);
72441
+ return;
72442
+ }
72373
72443
  next(err);
72374
72444
  }
72375
72445
  function indicateDone() {
72376
72446
  if (readFinished && pendingWrites.isZero() && !errorOccured) done();
72377
72447
  }
72378
- function abortWithError(uploadError) {
72448
+ function abortWithError(uploadError, skipPendingWait) {
72379
72449
  if (errorOccured) return;
72380
72450
  errorOccured = true;
72381
- pendingWrites.onceZero(function() {
72451
+ function finishAbort() {
72382
72452
  function remove2(file2, cb) {
72383
72453
  storage._removeFile(req, file2, cb);
72384
72454
  }
@@ -72387,11 +72457,45 @@ function requireMakeMiddleware() {
72387
72457
  uploadError.storageErrors = storageErrors;
72388
72458
  done(uploadError);
72389
72459
  });
72390
- });
72460
+ }
72461
+ if (skipPendingWait) {
72462
+ finishAbort();
72463
+ } else {
72464
+ pendingWrites.onceZero(finishAbort);
72465
+ }
72391
72466
  }
72392
72467
  function abortWithCode(code, optionalField) {
72393
72468
  abortWithError(new MulterError(code, optionalField));
72394
72469
  }
72470
+ function handleRequestFailure(err) {
72471
+ if (isDone) return;
72472
+ if (busboy) {
72473
+ req.unpipe(busboy);
72474
+ busboy.destroy(err);
72475
+ }
72476
+ abortWithError(err, true);
72477
+ }
72478
+ req.on("error", function(err) {
72479
+ handleRequestFailure(err || new Error("Request error"));
72480
+ });
72481
+ req.on("aborted", function() {
72482
+ handleRequestFailure(new Error("Request aborted"));
72483
+ });
72484
+ req.on("close", function() {
72485
+ if (req.readableEnded) return;
72486
+ handleRequestFailure(new Error("Request closed"));
72487
+ });
72488
+ try {
72489
+ busboy = Busboy({
72490
+ headers: req.headers,
72491
+ limits,
72492
+ preservePath,
72493
+ defParamCharset
72494
+ });
72495
+ } catch (err) {
72496
+ return next(err);
72497
+ }
72498
+ appender = new FileAppender(fileStrategy, req);
72395
72499
  busboy.on("field", function(fieldname, value, { nameTruncated, valueTruncated }) {
72396
72500
  if (fieldname == null) return abortWithCode("MISSING_FIELD_NAME");
72397
72501
  if (nameTruncated) return abortWithCode("LIMIT_FIELD_KEY");
@@ -72422,6 +72526,10 @@ function requireMakeMiddleware() {
72422
72526
  };
72423
72527
  var placeholder = appender.insertPlaceholder(file2);
72424
72528
  fileFilter(req, file2, function(err, includeFile) {
72529
+ if (errorOccured) {
72530
+ appender.removePlaceholder(placeholder);
72531
+ return fileStream.resume();
72532
+ }
72425
72533
  if (err) {
72426
72534
  appender.removePlaceholder(placeholder);
72427
72535
  return abortWithError(err);
@@ -72445,7 +72553,7 @@ function requireMakeMiddleware() {
72445
72553
  storage._handleFile(req, file2, function(err2, info) {
72446
72554
  if (aborting) {
72447
72555
  appender.removePlaceholder(placeholder);
72448
- uploadedFiles.push(extend2(file2, info));
72556
+ uploadedFiles.push({ ...file2, ...info });
72449
72557
  return pendingWrites.decrement();
72450
72558
  }
72451
72559
  if (err2) {
@@ -72453,7 +72561,7 @@ function requireMakeMiddleware() {
72453
72561
  pendingWrites.decrement();
72454
72562
  return abortWithError(err2);
72455
72563
  }
72456
- var fileInfo = extend2(file2, info);
72564
+ var fileInfo = { ...file2, ...info };
72457
72565
  appender.replacePlaceholder(placeholder, fileInfo);
72458
72566
  uploadedFiles.push(fileInfo);
72459
72567
  pendingWrites.decrement();
@@ -72483,95 +72591,6 @@ function requireMakeMiddleware() {
72483
72591
  makeMiddleware_1 = makeMiddleware;
72484
72592
  return makeMiddleware_1;
72485
72593
  }
72486
- var mkdirp;
72487
- var hasRequiredMkdirp;
72488
- function requireMkdirp() {
72489
- if (hasRequiredMkdirp) return mkdirp;
72490
- hasRequiredMkdirp = 1;
72491
- var path2 = path$1;
72492
- var fs2 = require$$0$9;
72493
- var _0777 = parseInt("0777", 8);
72494
- mkdirp = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP;
72495
- function mkdirP(p, opts, f, made) {
72496
- if (typeof opts === "function") {
72497
- f = opts;
72498
- opts = {};
72499
- } else if (!opts || typeof opts !== "object") {
72500
- opts = { mode: opts };
72501
- }
72502
- var mode2 = opts.mode;
72503
- var xfs = opts.fs || fs2;
72504
- if (mode2 === void 0) {
72505
- mode2 = _0777;
72506
- }
72507
- if (!made) made = null;
72508
- var cb = f || /* istanbul ignore next */
72509
- function() {
72510
- };
72511
- p = path2.resolve(p);
72512
- xfs.mkdir(p, mode2, function(er) {
72513
- if (!er) {
72514
- made = made || p;
72515
- return cb(null, made);
72516
- }
72517
- switch (er.code) {
72518
- case "ENOENT":
72519
- if (path2.dirname(p) === p) return cb(er);
72520
- mkdirP(path2.dirname(p), opts, function(er2, made2) {
72521
- if (er2) cb(er2, made2);
72522
- else mkdirP(p, opts, cb, made2);
72523
- });
72524
- break;
72525
- // In the case of any other error, just see if there's a dir
72526
- // there already. If so, then hooray! If not, then something
72527
- // is borked.
72528
- default:
72529
- xfs.stat(p, function(er2, stat2) {
72530
- if (er2 || !stat2.isDirectory()) cb(er, made);
72531
- else cb(null, made);
72532
- });
72533
- break;
72534
- }
72535
- });
72536
- }
72537
- mkdirP.sync = function sync(p, opts, made) {
72538
- if (!opts || typeof opts !== "object") {
72539
- opts = { mode: opts };
72540
- }
72541
- var mode2 = opts.mode;
72542
- var xfs = opts.fs || fs2;
72543
- if (mode2 === void 0) {
72544
- mode2 = _0777;
72545
- }
72546
- if (!made) made = null;
72547
- p = path2.resolve(p);
72548
- try {
72549
- xfs.mkdirSync(p, mode2);
72550
- made = made || p;
72551
- } catch (err0) {
72552
- switch (err0.code) {
72553
- case "ENOENT":
72554
- made = sync(path2.dirname(p), opts, made);
72555
- sync(p, opts, made);
72556
- break;
72557
- // In the case of any other error, just see if there's a dir
72558
- // there already. If so, then hooray! If not, then something
72559
- // is borked.
72560
- default:
72561
- var stat2;
72562
- try {
72563
- stat2 = xfs.statSync(p);
72564
- } catch (err1) {
72565
- throw err0;
72566
- }
72567
- if (!stat2.isDirectory()) throw err0;
72568
- break;
72569
- }
72570
- }
72571
- return made;
72572
- };
72573
- return mkdirp;
72574
- }
72575
72594
  var disk;
72576
72595
  var hasRequiredDisk;
72577
72596
  function requireDisk() {
@@ -72581,7 +72600,6 @@ function requireDisk() {
72581
72600
  var os2 = require$$1$2;
72582
72601
  var path2 = path$1;
72583
72602
  var crypto2 = require$$0$e;
72584
- var mkdirp2 = requireMkdirp();
72585
72603
  function getFilename(req, file2, cb) {
72586
72604
  crypto2.randomBytes(16, function(err, raw) {
72587
72605
  cb(err, err ? void 0 : raw.toString("hex"));
@@ -72593,7 +72611,7 @@ function requireDisk() {
72593
72611
  function DiskStorage(opts) {
72594
72612
  this.getFilename = opts.filename || getFilename;
72595
72613
  if (typeof opts.destination === "string") {
72596
- mkdirp2.sync(opts.destination);
72614
+ fs2.mkdirSync(opts.destination, { recursive: true });
72597
72615
  this.getDestination = function($0, $1, cb) {
72598
72616
  cb(null, opts.destination);
72599
72617
  };
@@ -75972,6 +75990,7 @@ function requireMulter() {
75972
75990
  }
75973
75991
  this.limits = options.limits;
75974
75992
  this.preservePath = options.preservePath;
75993
+ this.defParamCharset = options.defParamCharset || "latin1";
75975
75994
  this.fileFilter = options.fileFilter || allowAll;
75976
75995
  }
75977
75996
  Multer.prototype._makeMiddleware = function(fields, fileStrategy) {
@@ -75995,6 +76014,7 @@ function requireMulter() {
75995
76014
  return {
75996
76015
  limits: this.limits,
75997
76016
  preservePath: this.preservePath,
76017
+ defParamCharset: this.defParamCharset,
75998
76018
  storage: this.storage,
75999
76019
  fileFilter: wrappedFileFilter,
76000
76020
  fileStrategy
@@ -76019,6 +76039,7 @@ function requireMulter() {
76019
76039
  return {
76020
76040
  limits: this.limits,
76021
76041
  preservePath: this.preservePath,
76042
+ defParamCharset: this.defParamCharset,
76022
76043
  storage: this.storage,
76023
76044
  fileFilter: this.fileFilter,
76024
76045
  fileStrategy: "ARRAY"
@@ -76159,6 +76180,13 @@ function serializeResult(result) {
76159
76180
  }
76160
76181
  return result;
76161
76182
  }
76183
+ function isDockerEnvironment() {
76184
+ try {
76185
+ return existsSync$1("/.dockerenv");
76186
+ } catch {
76187
+ return false;
76188
+ }
76189
+ }
76162
76190
  function isListenAllInterfaces(host) {
76163
76191
  return !host || host === "0.0.0.0" || host === "::";
76164
76192
  }
@@ -76184,16 +76212,19 @@ function createConfigRoutes(ctx) {
76184
76212
  const router2 = expressExports.Router();
76185
76213
  router2.get("/network-interfaces", (req, res) => {
76186
76214
  try {
76215
+ const isDocker = isDockerEnvironment();
76187
76216
  const interfaces = networkInterfaces();
76188
76217
  const addresses = [];
76189
- for (const name2 in interfaces) {
76190
- for (const iface of interfaces[name2] || []) {
76191
- if (iface.family === "IPv4" && !iface.internal) {
76192
- addresses.push(iface.address);
76218
+ if (!isDocker) {
76219
+ for (const name2 in interfaces) {
76220
+ for (const iface of interfaces[name2] || []) {
76221
+ if (iface.family === "IPv4" && !iface.internal) {
76222
+ addresses.push(iface.address);
76223
+ }
76193
76224
  }
76194
76225
  }
76195
76226
  }
76196
- res.json({ success: true, data: addresses });
76227
+ res.json({ success: true, data: addresses, isDocker });
76197
76228
  } catch (e) {
76198
76229
  res.status(500).json({ success: false, message: "获取网卡列表失败", error: e });
76199
76230
  }
@@ -76636,7 +76667,6 @@ function createProxyRoutes(ctx) {
76636
76667
  return;
76637
76668
  }
76638
76669
  let url2 = decodeURIComponent(urlParam);
76639
- ctx.logger.info("图片代理请求:", url2);
76640
76670
  let parsedUrl;
76641
76671
  try {
76642
76672
  parsedUrl = new URL(url2);
@@ -76657,7 +76687,6 @@ function createProxyRoutes(ctx) {
76657
76687
  const rkey = appid === "1406" ? rkeyData.private_rkey : rkeyData.group_rkey;
76658
76688
  if (rkey) {
76659
76689
  url2 = url2 + rkey;
76660
- ctx.logger.info("已添加 rkey 到图片 URL");
76661
76690
  }
76662
76691
  }
76663
76692
  } catch (e) {
@@ -77206,6 +77235,7 @@ data: ${JSON.stringify(serializedData)}
77206
77235
  const target = notify.reaction.data.body.target;
77207
77236
  const groupCode = String(notify.groupCode);
77208
77237
  const userId = await this.ctx.ntUserApi.getUinByUid(info.operatorUid);
77238
+ const actionType = typeof info.actionType === "number" ? info.actionType : info.type;
77209
77239
  let userName = userId;
77210
77240
  try {
77211
77241
  const membersResult = await this.ctx.ntGroupApi.getGroupMembers(groupCode);
@@ -77227,7 +77257,7 @@ data: ${JSON.stringify(serializedData)}
77227
77257
  emojiId: info.code,
77228
77258
  userId,
77229
77259
  userName,
77230
- isAdd: info.type === 1
77260
+ isAdd: actionType === 1
77231
77261
  }
77232
77262
  });
77233
77263
  }
@@ -77530,7 +77560,7 @@ function requireCookies() {
77530
77560
  return cookies;
77531
77561
  }
77532
77562
  const name = "nodemailer";
77533
- const version = "8.0.1";
77563
+ const version = "8.0.2";
77534
77564
  const homepage = "https://nodemailer.com/";
77535
77565
  const require$$10 = {
77536
77566
  name,
@@ -81748,6 +81778,14 @@ function requireAddressparser() {
81748
81778
  parsedAddresses = parsedAddresses.concat(address2);
81749
81779
  }
81750
81780
  });
81781
+ for (let i = parsedAddresses.length - 2; i >= 0; i--) {
81782
+ let current = parsedAddresses[i];
81783
+ let next = parsedAddresses[i + 1];
81784
+ if (current.address === "" && current.name && !current.group && next.address && next.name && !next.group) {
81785
+ next.name = current.name + ", " + next.name;
81786
+ parsedAddresses.splice(i, 1);
81787
+ }
81788
+ }
81751
81789
  if (options.flatten) {
81752
81790
  let addresses2 = [];
81753
81791
  let walkAddressList = (list) => {
@@ -88895,7 +88933,7 @@ class EmailNotificationService extends Service2 {
88895
88933
  }
88896
88934
  }
88897
88935
  registerPmhqDisconnectCallback() {
88898
- this.pmhqDisconnectId = pmhq.onDisconnect(6e4, (duration2) => {
88936
+ this.pmhqDisconnectId = pmhq.onDisconnect(1e4, (duration2) => {
88899
88937
  if (!this.notificationSent && this.hasLoggedIn) {
88900
88938
  this.ctx.logger.warn(`[EmailNotification] PMHQ disconnected for ${duration2}ms`);
88901
88939
  this.onOffline("可能 QQ 已经有点死了");
@@ -88943,13 +88981,6 @@ class EmailNotificationService extends Service2 {
88943
88981
  return this.configManager;
88944
88982
  }
88945
88983
  }
88946
- function isDockerEnvironment() {
88947
- try {
88948
- return existsSync$1("/.dockerenv");
88949
- } catch {
88950
- return false;
88951
- }
88952
- }
88953
88984
  process.on("uncaughtException", (err) => {
88954
88985
  console.error("[uncaughtException]", err?.message || err);
88955
88986
  });