feat(gossip): GUILD_SYNC bundle for message history on join
Wire RPC.GUILD_SYNC through gossip mesh: gossipGuildSync broadcast, _onGossip + simulateGossip handlers, and guild-sync event emission. Existing peers push channel/message/attachment snapshots when new members connect or MEMBER_JOIN is received. Phase 61 / v0.8.26. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -401,6 +401,9 @@ class PearcordGuild extends EventEmitter {
|
||||
if (method === RPC.SOUND_PLAY) {
|
||||
this.emit('guild-sound-play', payload)
|
||||
}
|
||||
if (method === RPC.GUILD_SYNC) {
|
||||
this.emit('guild-sync', payload)
|
||||
}
|
||||
}
|
||||
|
||||
/** Deterministic gossip injection for Bare smokes (no live mesh). */
|
||||
@@ -449,6 +452,10 @@ class PearcordGuild extends EventEmitter {
|
||||
this.emit('guild-sound-play', payload)
|
||||
return
|
||||
}
|
||||
if (method === RPC.GUILD_SYNC) {
|
||||
this.emit('guild-sync', payload)
|
||||
return
|
||||
}
|
||||
if (method === RPC.PROFILE_COSMETIC_UPDATE) {
|
||||
this.emit('profile-cosmetic', payload)
|
||||
return
|
||||
@@ -496,6 +503,10 @@ class PearcordGuild extends EventEmitter {
|
||||
broadcastGossip(this, RPC.MEMBER_JOIN, member)
|
||||
}
|
||||
|
||||
gossipGuildSync (payload) {
|
||||
return broadcastGossip(this, RPC.GUILD_SYNC, payload)
|
||||
}
|
||||
|
||||
gossipAttachmentMeta (attachment) {
|
||||
broadcastGossip(this, RPC.ATTACHMENT_META, attachment)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user