Skip to content

Commit 6362c23

Browse files
committed
add lifetime
1 parent 7c996bb commit 6362c23

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

proposals/4075-call-notify-event.md

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ This event contains the following fields by leveraging intentional mentions.
2525
```json5
2626
{
2727
"content": {
28+
"sender_ts": 1752583130365,
29+
"lifetime": 30000,
2830
"m.mentions": {"user_ids": [], "room": true | false},
2931
"m.relates_to": {"rel_type":"m.rtc.notification", "eventId":"$rtc_member_event_id"},
3032
"notification_type": "ring | notification",
@@ -34,6 +36,14 @@ This event contains the following fields by leveraging intentional mentions.
3436

3537
The fields are defined as follows:
3638

39+
- `sender_ts` the local timestamp observed by the sender device. Is used in combination with lifetime to evaluate if
40+
the notification event is valid. To mitigate clients lying about the `sender_ts` this value has to be checked with `origin_server_ts`.
41+
The diff between `sender_ts` and `origin_server_ts` should be at most 20s.
42+
If not the `origin_server_ts` should be used for the lifetime
43+
computation instead.
44+
- `lifetime` the relative time to the `sender_ts` for which the `ring` is active or to define the window in which the
45+
`notification` is not ignored. The recommended value is **30 seconds**.
46+
The receiving client **should** cap the lifetime to an upper bound. (recommended: **2 minutes**).
3747
- `m.mentions` optional:\
3848
Has the structure as defined for `m.mentions` in the [Client-Server API](https://spec.matrix.org/v1.11/client-server-api/#definition-mmentions).
3949
- `notification_type` required string:\
@@ -86,12 +96,12 @@ The client should only inform the user if all of the following conditions apply:
8696
This includes stopping the current ring sound if the room state updates so
8797
this condition is true.
8898
- If a notify event is received in "real time":\
89-
Notify events that are older then **20 seconds** are ignored (using the local
90-
timestamp computed via `unsigned.age`).\
99+
Notify events that are older then **`lifetime`** are ignored (using the
100+
`sender_ts` timestamp).\
91101
Otherwise a client syncing for the first time would ring for outdated call events.
92-
In general ringing only makes sense in "real time". A 20 second syncing latency
93-
is allowed. Any client which is not able to receive the event in this period should
94-
not ring to prohibit (annoying/misleading/irrelevant) outdated rings.
102+
In general ringing only makes sense in "real time".
103+
Any client which is not able to receive the event in the `lifetime` period should
104+
not ring to prohibit annoying/misleading/irrelevant/outdated rings.
95105

96106
### Client behaviour when sending a `m.rtc.notification` event
97107

@@ -107,6 +117,9 @@ Sending a `m.rtc.notification` should happen only if all of these conditions app
107117
is the first user in a new call session).
108118
- If possible the user should first send their `m.rtc.member` event first to allow setting up the relation
109119
for the notify event.
120+
- The sending client can compute the "exact" (or at least "a good approximation" if the local clocks are not configured correctly)
121+
at which the `m.rtc.notification` ring will end using the `lifeitime` + `start_ts`. This allows the sending client to
122+
show a local dialing/ringing animation/indicator/sound.
110123

111124
### Limitations and recommendations
112125

@@ -138,8 +151,8 @@ Sending a `m.rtc.notification` should happen only if all of these conditions app
138151
It would be possible to use the call member room state events to determine a call
139152
start.
140153
The logic would be as following:
141-
_If we receive an event we check if are already other members
142-
(call.member events) for the call. In case there is not we make the phone ring._
154+
*If we receive an event we check if are already other members
155+
(call.member events) for the call. In case there is not we make the phone ring.*
143156

144157
Pros:
145158

0 commit comments

Comments
 (0)