feat(platform): screen share refresh and presence stale reaper
Add refreshScreenSharePreview for frozen stream recovery and invoke presence.reapStalePeers during view() so ghost peers are cleared. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -13728,6 +13728,22 @@ class PearcordPlatform extends EventEmitter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Restart local share or drop stale remote preview tile (Phase 408 P408-34). */
|
||||||
|
async refreshScreenSharePreview (userId = null) {
|
||||||
|
const uid = userId || this.identity?.user?.id
|
||||||
|
if (!uid || !this.screenShare) return null
|
||||||
|
if (uid === this.identity?.user?.id && this.screenShare.active) {
|
||||||
|
const label = this.screenShare.label || 'Screen'
|
||||||
|
await this.stopScreenShare()
|
||||||
|
return this.startScreenShare(label)
|
||||||
|
}
|
||||||
|
if (this.screenShare.previews?.delete) {
|
||||||
|
this.screenShare.previews.delete(uid)
|
||||||
|
}
|
||||||
|
this.emit('screen-share')
|
||||||
|
return { refreshed: uid }
|
||||||
|
}
|
||||||
|
|
||||||
async _firstViewableChannel (channels, preferType) {
|
async _firstViewableChannel (channels, preferType) {
|
||||||
const list = channels || []
|
const list = channels || []
|
||||||
if (preferType) {
|
if (preferType) {
|
||||||
@@ -22506,6 +22522,13 @@ class PearcordPlatform extends EventEmitter {
|
|||||||
!dismissedRekeys.has(this._dmSessionRekeyNotice.channelId)
|
!dismissedRekeys.has(this._dmSessionRekeyNotice.channelId)
|
||||||
? this._dmSessionRekeyNotice
|
? this._dmSessionRekeyNotice
|
||||||
: null
|
: null
|
||||||
|
if (this.presence?.reapStalePeers) {
|
||||||
|
try {
|
||||||
|
this.presence.reapStalePeers()
|
||||||
|
} catch {
|
||||||
|
/* presence optional during teardown */
|
||||||
|
}
|
||||||
|
}
|
||||||
const activityFeed = buildActivityFeed({
|
const activityFeed = buildActivityFeed({
|
||||||
selfUserId: user?.id,
|
selfUserId: user?.id,
|
||||||
presence: this.presence?.snapshot() || null,
|
presence: this.presence?.snapshot() || null,
|
||||||
|
|||||||
Reference in New Issue
Block a user