fix: 添加了新的字段代替 chat id

* 谁又能想到 chat id 的可变性和依赖性恰恰埋下了祸患呢
This commit is contained in:
CrescentLeaf
2025-10-24 22:21:28 +08:00
parent afd9193dea
commit 2d78e39ca1
9 changed files with 49 additions and 38 deletions

View File

@@ -317,7 +317,7 @@ export default class UserApi extends BaseApi {
}
const user = User.findById(token.author) as User
const chat = Chat.findById(args.target as string)
const chat = Chat.findById(args.target as string) || Chat.findByName(args.target as string)
const targetUser = User.findByAccount(args.target as string) as User
if (chat)
user!.addContact(chat.bean.id)