mirror of
https://wget.la/https://github.com/Wxw-Gu/WechatExplorer
synced 2026-10-06 13:54:10 +08:00
修复 Windows 会话名称和密钥显示图标
This commit is contained in:
@@ -601,6 +601,11 @@ export class Wcdb4Client {
|
||||
.map((row) => this.normalizeSession(row))
|
||||
.filter((session) => session.username)
|
||||
|
||||
this.hydrateDisplayNames(
|
||||
sessions
|
||||
.filter((session) => this.shouldHydrateSessionDisplayName(session))
|
||||
.map((session) => session.username)
|
||||
)
|
||||
this.cachedSessions = sessions.map((session) => ({
|
||||
...session,
|
||||
nickname: this.displayNameCache.get(session.username) || session.nickname || session.username
|
||||
@@ -1541,6 +1546,17 @@ export class Wcdb4Client {
|
||||
}
|
||||
}
|
||||
|
||||
private shouldHydrateSessionDisplayName(session: Wcdb4Session): boolean {
|
||||
const username = String(session.username || '').trim()
|
||||
const nickname = String(session.nickname || '').trim()
|
||||
if (!username) return false
|
||||
if (!nickname) return true
|
||||
if (nickname === username) return true
|
||||
if (nickname.endsWith('@chatroom')) return true
|
||||
if (nickname.startsWith('Group_') || nickname.startsWith('Unknown_')) return true
|
||||
return false
|
||||
}
|
||||
|
||||
private hydrateDisplayNames(usernames: string[]): void {
|
||||
if (!this.wcdbGetDisplayNames) return
|
||||
const missing = this.uniq(usernames).filter((username) => !this.displayNameCache.has(username))
|
||||
|
||||
Reference in New Issue
Block a user