You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
1.6 KiB
ReStructuredText
62 lines
1.6 KiB
ReStructuredText
10 years ago
|
Typing Notifications
|
||
9 years ago
|
--------------------
|
||
10 years ago
|
|
||
|
Client APIs
|
||
9 years ago
|
~~~~~~~~~~~
|
||
10 years ago
|
|
||
|
To set "I am typing for the next N msec"::
|
||
9 years ago
|
|
||
10 years ago
|
PUT .../rooms/<room_id>/typing/<user_id>
|
||
10 years ago
|
Content: { "typing": true, "timeout": N }
|
||
9 years ago
|
# timeout is in milliseconds; suggested no more than 20 or 30 seconds
|
||
10 years ago
|
|
||
|
This should be re-sent by the client to continue informing the server the user
|
||
9 years ago
|
is still typing; a safety margin of 5 seconds before the expected
|
||
|
timeout runs out is recommended. Just keep declaring a new timeout, it will
|
||
|
replace the old one.
|
||
10 years ago
|
|
||
|
To set "I am no longer typing"::
|
||
9 years ago
|
|
||
10 years ago
|
PUT ../rooms/<room_id>/typing/<user_id>
|
||
10 years ago
|
Content: { "typing": false }
|
||
|
|
||
|
Client Events
|
||
9 years ago
|
~~~~~~~~~~~~~
|
||
10 years ago
|
|
||
|
All room members will receive an event on the event stream::
|
||
|
|
||
|
{
|
||
|
"type": "m.typing",
|
||
|
"room_id": "!room-id-here:matrix.org",
|
||
10 years ago
|
"content": {
|
||
|
"user_ids": ["list of", "every user", "who is", "currently typing"]
|
||
|
}
|
||
10 years ago
|
}
|
||
|
|
||
|
The client must use this list to *REPLACE* its knowledge of every user who is
|
||
|
currently typing. The reason for this is that the server DOES NOT remember
|
||
|
users who are not currently typing, as that list gets big quickly. The client
|
||
|
should mark as not typing, any user ID who is not in that list.
|
||
|
|
||
|
Server APIs
|
||
9 years ago
|
~~~~~~~~~~~
|
||
10 years ago
|
|
||
|
Servers will emit EDUs in the following form::
|
||
|
|
||
|
{
|
||
|
"type": "m.typing",
|
||
|
"content": {
|
||
|
"room_id": "!room-id-here:matrix.org",
|
||
|
"user_id": "@user-id-here:matrix.org",
|
||
9 years ago
|
"typing": true/false
|
||
10 years ago
|
}
|
||
|
}
|
||
|
|
||
|
Server EDUs don't (currently) contain timing information; it is up to
|
||
|
originating HSes to ensure they eventually send "stop" notifications.
|
||
|
|
||
9 years ago
|
.. TODO
|
||
|
((This will eventually need addressing, as part of the wider typing/presence
|
||
|
timer addition work))
|
||
10 years ago
|
|