Skip to content

Commit fc9e277

Browse files
authored
chathistory: Add MSGREFTYPES ISUPPORT token (#510)
1 parent f5fc907 commit fc9e277

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

extensions/chathistory.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ copyrights:
1414
name: "Shivaram Lingamneni"
1515
period: "2020"
1616
17+
-
18+
name: "Val Lorentz"
19+
period: "2022"
20+
1721
---
1822

1923
## Notes for implementing work-in-progress version
@@ -36,10 +40,22 @@ Full support for this extension requires support for the [`batch`][batch], [`ser
3640

3741
The `draft/chathistory` capability MUST be negotiated. This allows the server and client to behave differently when history is available and can be queried. In particular, if a client requests this capability, the server (or bouncer) SHOULD NOT play back any history that would otherwise be sent automatically.
3842

39-
An ISUPPORT token MUST be sent to the client to state the maximum number of messages a client can request in a single command, e.g., `CHATHISTORY=50`. If `0`, the client SHOULD assume that there is no maximum number of messages.
40-
4143
The `draft/event-playback` capability MAY be negotiated. This allows the client to signal that it is capable of receiving and correctly processing lines that would normally produce a local state change (such as `JOIN` or `MODE`) in its history batches.
4244

45+
### ISUPPORT tokens
46+
47+
This specification defines two ISUPPORT tokens.
48+
49+
`CHATHISTORY` MUST be sent to the client to state the maximum number of messages a client can request in a single command, e.g., `CHATHISTORY=50`. If `0`, the client SHOULD assume that there is no maximum number of messages.
50+
51+
`MSGREFTYPES` SHOULD be sent, with a comma-separated list of types of message references they support as parameter to `CHATHISTORY` commands, in order of decreasing preference. Clients MUST ignore any type they do not support. The currently defined list of types is:
52+
53+
* `timestamp`, to reference messages by their timestamp
54+
* `msgid`, to reference them by their `msgid`
55+
56+
If `MSGREFTYPES` is missing, clients SHOULD assume the server supports both and has no preference.
57+
58+
4359
### `CHATHISTORY` Command
4460
The client can request message history content by sending the `CHATHISTORY` command to the server. This command has the following general syntax:
4561

@@ -129,6 +145,10 @@ If no message history can be returned due to an error, the `MESSAGE_ERROR` error
129145

130146
FAIL CHATHISTORY MESSAGE_ERROR the_given_command the_given_target [extra_context] :Messages could not be retrieved
131147

148+
If a client used a reference type (`timestamp=` or `msgid=`) the server does not support, the `INVALID_MSGREFTYPE` error code SHOULD be returned:
149+
150+
FAIL CHATHISTORY INVALID_MSGREFTYPE the_given_command the_given_target [extra_context] :msgid-based history requests are not supported
151+
132152
### Examples
133153

134154
Requesting the latest conversation upon joining a channel

0 commit comments

Comments
 (0)