From 92875b5f31b95d98b3379bdd29ae328f9571eb56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AD=89=E9=A3=8E=E6=9D=A5?= Date: Thu, 8 Aug 2024 13:40:57 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E5=BC=95=E7=94=A8=E5=8E=9F=E5=9B=BE?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/profile/ProfileUtils.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/profile/ProfileUtils.js b/apps/profile/ProfileUtils.js index 46169a99..9bb6ce9e 100644 --- a/apps/profile/ProfileUtils.js +++ b/apps/profile/ProfileUtils.js @@ -15,16 +15,16 @@ export async function getOriginalPicture (e) { if (e.source.user_id !== e.self_id) { return false } - // 引用的消息不是纯图片 - if (!/^\[图片]$/.test(e.source.message)) { - return false - } // 获取原消息 if (e.group?.getChatHistory) { source = (await e.group.getChatHistory(e.source.seq, 1)).pop() } else if (e.friend?.getChatHistory) { source = (await e.friend.getChatHistory(e.source.time, 1)).pop() } + // 引用的不是纯图片 + if (!(source?.message?.length === 1 && source?.message[0]?.type === 'image')) { + return false + } } let originalPic = Cfg.get('originalPic') * 1 if (source) {