@@ -25,6 +25,8 @@ This event contains the following fields by leveraging intentional mentions.
25
25
``` json5
26
26
{
27
27
" content" : {
28
+ " sender_ts" : 1752583130365 ,
29
+ " lifetime" : 30000 ,
28
30
" m.mentions" : {" user_ids" : [], " room" : true | false },
29
31
" m.relates_to" : {" rel_type" : " m.rtc.notification" , " eventId" : " $rtc_member_event_id" },
30
32
" notification_type" : " ring | notification" ,
@@ -34,6 +36,14 @@ This event contains the following fields by leveraging intentional mentions.
34
36
35
37
The fields are defined as follows:
36
38
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** ).
37
47
- ` m.mentions ` optional:\
38
48
Has the structure as defined for ` m.mentions ` in the [ Client-Server API] ( https://spec.matrix.org/v1.11/client-server-api/#definition-mmentions ) .
39
49
- ` notification_type ` required string:\
@@ -86,12 +96,12 @@ The client should only inform the user if all of the following conditions apply:
86
96
This includes stopping the current ring sound if the room state updates so
87
97
this condition is true.
88
98
- 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 ).\
91
101
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.
95
105
96
106
### Client behaviour when sending a ` m.rtc.notification ` event
97
107
@@ -107,6 +117,9 @@ Sending a `m.rtc.notification` should happen only if all of these conditions app
107
117
is the first user in a new call session).
108
118
- If possible the user should first send their ` m.rtc.member ` event first to allow setting up the relation
109
119
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.
110
123
111
124
### Limitations and recommendations
112
125
@@ -138,8 +151,8 @@ Sending a `m.rtc.notification` should happen only if all of these conditions app
138
151
It would be possible to use the call member room state events to determine a call
139
152
start.
140
153
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.*
143
156
144
157
Pros:
145
158
0 commit comments