mirror of
https://wget.la/https://github.com/Wxw-Gu/WechatExplorer
synced 2026-10-08 07:21:19 +08:00
fix: 更新打包配置并修复群昵称刷新
更新跨平台 WCDB 和运行时命名。 优化消息获取速度 修复群昵称刷新回退与消息发送者显示,并增加可控的消息读取诊断日志和有界查询优化。
This commit is contained in:
@@ -110,4 +110,35 @@ describe('WCDB group member names', () => {
|
||||
expectedMember({ nickname: '真实群昵称', wechatNickname: '', remark: '' })
|
||||
])
|
||||
})
|
||||
|
||||
it('uses the group nickname for message sender display before contact display names', () => {
|
||||
const client = Object.assign(Object.create(Wcdb4Client.prototype), {
|
||||
accountRoot: '/fixture/account',
|
||||
displayNameCache: new Map([['wxid-member', '通讯录昵称']]),
|
||||
getGroupNicknames: vi.fn(() => new Map([['wxid-member', '真实群昵称']])),
|
||||
avatarCache: new Map<string, string>(),
|
||||
myWxid: '',
|
||||
wxid: ''
|
||||
}) as Wcdb4Client
|
||||
|
||||
const finalizeMessages = (client as unknown as {
|
||||
finalizeMessages: (
|
||||
username: string,
|
||||
rows: Record<string, unknown>[]
|
||||
) => Array<{ senderNickname?: string }>
|
||||
}).finalizeMessages
|
||||
|
||||
expect(
|
||||
finalizeMessages.call(client, 'fixture@chatroom', [
|
||||
{
|
||||
sender_username: 'wxid-member',
|
||||
create_time: 1731327263,
|
||||
local_id: 1,
|
||||
local_type: 1,
|
||||
msg_content: 'fixture'
|
||||
}
|
||||
])
|
||||
).toMatchObject([{ senderNickname: '真实群昵称' }])
|
||||
expect(client.getGroupNicknames).toHaveBeenCalledWith('fixture@chatroom')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user