fix: expire stale call pushes
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user