fix: expire stale call pushes

This commit is contained in:
richjohnrambo
2026-09-14 12:11:43 +08:00
parent 4854e090ef
commit 789e662bdb
8 changed files with 164 additions and 14 deletions
+8
View File
@@ -49,6 +49,14 @@ func (t *Topic) pushForData(fromUid types.Uid, data *MsgServerData, msgMarkedAsR
receipt.Payload.Webrtc = webrtc
audioOnly, _ := data.Head["aonly"].(bool)
receipt.Payload.AudioOnly = audioOnly
if webrtc == constCallMsgStarted {
timeout := imCallTimeoutSeconds()
if timeout <= 0 {
timeout = defaultCallEstablishmentTimeout
}
expiresAt := data.Timestamp.Add(time.Duration(timeout) * time.Second)
receipt.Payload.ExpiresAt = &expiresAt
}
}
if replace, found := data.Head["replace"].(string); found {
receipt.Payload.Replace = replace