fix(profile): prefetch banner bytes over mesh before drive read (v0.8.19)
_ensureBannerAttachmentReady calls _prefetchBannerFromPeers when guild mesh is active. _gossipProfileCosmetics awaits guild gossip broadcast. Supports Phase 54 live peer banner fetch in PearcordPlatform. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -602,7 +602,7 @@ class PearcordPlatform extends EventEmitter {
|
|||||||
async _gossipProfileCosmetics () {
|
async _gossipProfileCosmetics () {
|
||||||
const payload = await this._profileCosmeticGossipPayload()
|
const payload = await this._profileCosmeticGossipPayload()
|
||||||
if (!payload) return
|
if (!payload) return
|
||||||
if (this.guild) this.guild.gossipProfileCosmetic(payload)
|
if (this.guild) await this.guild.gossipProfileCosmetic(payload)
|
||||||
if (this.contacts) this.contacts.broadcastProfileCosmetic(payload)
|
if (this.contacts) this.contacts.broadcastProfileCosmetic(payload)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -630,6 +630,9 @@ class PearcordPlatform extends EventEmitter {
|
|||||||
}
|
}
|
||||||
if (!row) throw new Error('banner attachment not found')
|
if (!row) throw new Error('banner attachment not found')
|
||||||
if (!this.attachments.hasLocalBytes(row)) {
|
if (!this.attachments.hasLocalBytes(row)) {
|
||||||
|
if (this.guild) {
|
||||||
|
await this._prefetchBannerFromPeers(attachmentId).catch(() => {})
|
||||||
|
}
|
||||||
await this.readAttachmentBytes(attachmentId)
|
await this.readAttachmentBytes(attachmentId)
|
||||||
}
|
}
|
||||||
return row
|
return row
|
||||||
|
|||||||
Reference in New Issue
Block a user