chathistory: add draft/chathistory-end tag#598
chathistory: add draft/chathistory-end tag#598emersion wants to merge 2 commits intoircv3:masterfrom
Conversation
|
From #437, should we warn clients that a response with fewer than |
|
I've pushed a suggestion to that effect. I've chosen to spec that servers SHOULD apply the exact limit, because a server completely ignoring the limit would cause havoc - is that too strong for your taste? |
|
SHOULD does seem a little strong to me because there are conditions where Ergo will predictably violate the limit (for example, relaying stored multiline messages to non-multiline-capable clients). I expect other servers will run into similar conditions. That said, I don't have very strong feelings, and the current language gives servers explicit permission to deviate. |
|
If you have ideas for an alternative wording, please feel free to suggest! |
Parse the draft/chathistory-end tag from BATCH START lines and use it to set history_exhausted immediately, avoiding an extra empty-batch round-trip. Existing heuristics (empty batch, stale count) remain as fallback for servers that don't send the tag. See ircv3/ircv3-specifications#598 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
I think basically just reversing the capitalization:
|
544d950 to
2c52155
Compare
|
Works for me, I've pushed this wording! |
|
|
||
| A `timestamp` parameter MUST have the format `timestamp=YYYY-MM-DDThh:mm:ss.sssZ`, as in the [server-time][server-time] extension. A `msgid` parameter MUST have the format `msgid=foobar`, as in the [message-ids][message-ids] extension. | ||
|
|
||
| A `limit` parameter MUST be a positive integer. Server should attempt to return exactly `limit` messages (or as many as available), but MAY return more or fewer due to implementation constraints. The `draft/chathistory-end` tag indicates whether more messages are available. |
There was a problem hiding this comment.
"Servers" plural, I think
2c52155 to
47cc200
Compare
…cations#598) When a CHATHISTORY (or TARGETS) response contains fewer messages than the requested limit, attach the draft/chathistory-end tag to the BATCH opener to signal end-of-pagination to the client. - Register a MessageTagHandler for draft/chathistory-end in the chathistory module, tied to the draft/chathistory capability so the tag is only delivered to capable clients - history_send_result() gains an end_of_pagination parameter; when true, the tag is attached to the 'BATCH +ID chathistory' opener - chathistory_targets() attaches the tag to the 'BATCH +ID draft/chathistory-targets' opener when the target count is below the requested limit - cmd_chathistory() counts logical head-messages in the result and sets end_of_pagination when the count is below filter->limit - Auto-playback callers (chanmodes/history.c, history.c) pass 0
See #437 (comment)
Implementations: