mirror of
https://github.com/hicccc77/WeFlow.git
synced 2026-03-24 23:06:51 +00:00
Merge branch 'dev' of https://github.com/hicccc77/WeFlow into dev
This commit is contained in:
@@ -5055,7 +5055,17 @@ class ChatService {
|
||||
|
||||
const contact = await this.getContact(username)
|
||||
const avatarResult = await wcdbService.getAvatarUrls([username])
|
||||
const avatarUrl = avatarResult.success && avatarResult.map ? avatarResult.map[username] : undefined
|
||||
let avatarUrl = avatarResult.success && avatarResult.map ? avatarResult.map[username] : undefined
|
||||
if (!this.isValidAvatarUrl(avatarUrl)) {
|
||||
avatarUrl = undefined
|
||||
}
|
||||
if (!avatarUrl) {
|
||||
const headImageAvatars = await this.getAvatarsFromHeadImageDb([username])
|
||||
const fallbackAvatarUrl = headImageAvatars[username]
|
||||
if (this.isValidAvatarUrl(fallbackAvatarUrl)) {
|
||||
avatarUrl = fallbackAvatarUrl
|
||||
}
|
||||
}
|
||||
const displayName = contact?.remark || contact?.nickName || contact?.alias || cached?.displayName || username
|
||||
const cacheEntry: ContactCacheEntry = {
|
||||
avatarUrl,
|
||||
@@ -5523,6 +5533,13 @@ class ChatService {
|
||||
avatarUrl = avatarCandidate
|
||||
}
|
||||
}
|
||||
if (!avatarUrl) {
|
||||
const headImageAvatars = await this.getAvatarsFromHeadImageDb([normalizedSessionId])
|
||||
const fallbackAvatarUrl = headImageAvatars[normalizedSessionId]
|
||||
if (this.isValidAvatarUrl(fallbackAvatarUrl)) {
|
||||
avatarUrl = fallbackAvatarUrl
|
||||
}
|
||||
}
|
||||
|
||||
if (!Number.isFinite(messageCount)) {
|
||||
messageCount = messageCountResult.status === 'fulfilled' &&
|
||||
|
||||
@@ -53,6 +53,7 @@ interface ConfigSchema {
|
||||
notificationFilterList: string[]
|
||||
messagePushEnabled: boolean
|
||||
windowCloseBehavior: 'ask' | 'tray' | 'quit'
|
||||
quoteLayout: 'quote-top' | 'quote-bottom'
|
||||
wordCloudExcludeWords: string[]
|
||||
}
|
||||
|
||||
@@ -120,6 +121,7 @@ export class ConfigService {
|
||||
notificationFilterList: [],
|
||||
messagePushEnabled: false,
|
||||
windowCloseBehavior: 'ask',
|
||||
quoteLayout: 'quote-top',
|
||||
wordCloudExcludeWords: []
|
||||
}
|
||||
|
||||
|
||||
@@ -1000,6 +1000,26 @@ class ExportService {
|
||||
return `${localType}_${this.getStableMessageKey(msg)}`
|
||||
}
|
||||
|
||||
private getImageMissingRunCacheKey(
|
||||
sessionId: string,
|
||||
imageMd5?: unknown,
|
||||
imageDatName?: unknown,
|
||||
imageDeepSearchOnMiss = true
|
||||
): string | null {
|
||||
const normalizedSessionId = String(sessionId || '').trim()
|
||||
const normalizedImageMd5 = String(imageMd5 || '').trim().toLowerCase()
|
||||
const normalizedImageDatName = String(imageDatName || '').trim().toLowerCase()
|
||||
if (!normalizedSessionId) return null
|
||||
if (!normalizedImageMd5 && !normalizedImageDatName) return null
|
||||
|
||||
const primaryToken = normalizedImageMd5 || normalizedImageDatName
|
||||
const secondaryToken = normalizedImageMd5 && normalizedImageDatName && normalizedImageDatName !== normalizedImageMd5
|
||||
? normalizedImageDatName
|
||||
: ''
|
||||
const lookupMode = imageDeepSearchOnMiss ? 'deep' : 'hardlink'
|
||||
return `${lookupMode}\u001f${normalizedSessionId}\u001f${primaryToken}\u001f${secondaryToken}`
|
||||
}
|
||||
|
||||
private normalizeEmojiMd5(value: unknown): string | undefined {
|
||||
const md5 = String(value || '').trim().toLowerCase()
|
||||
if (!/^[a-f0-9]{32}$/.test(md5)) return undefined
|
||||
|
||||
Reference in New Issue
Block a user