IRC: a long message is cut rather than continued #158

Closed
opened 2026-09-10 15:45:08 -04:00 by Salastil · 1 comment
Owner

draft/multiline lets one message span several lines instead of being truncated at
the network's byte limit or silently split into two messages that arrive as two.

Today a long paste is whatever the server does with it. Every other protocol here
takes a message of any length.

What is needed

  • Request draft/multiline, and send long messages as a BATCH of PRIVMSG lines
    with the multiline batch type. batch is already requested
    (backend/irc/connect.rs:461), so the receive side has the machinery.
  • Reassemble an inbound multiline batch into one message.

Done looks like: a long message arrives as one message.

One of the four draft IRCv3 extensions that actively-maintained clients already ship
(WeeChat, Halloy, bIRC). The other eight drafts were scored by the 2026-09-10 coverage
review and deliberately not filed: they can still change underneath an implementation.
moho currently implements 1 of the 12 drafts (chathistory).

`draft/multiline` lets one message span several lines instead of being truncated at the network's byte limit or silently split into two messages that arrive as two. Today a long paste is whatever the server does with it. Every other protocol here takes a message of any length. **What is needed** - Request `draft/multiline`, and send long messages as a `BATCH` of `PRIVMSG` lines with the multiline batch type. `batch` is already requested (`backend/irc/connect.rs:461`), so the receive side has the machinery. - Reassemble an inbound multiline batch into one message. **Done looks like:** a long message arrives as one message. One of the four draft IRCv3 extensions that actively-maintained clients already ship (WeeChat, Halloy, bIRC). The other eight drafts were scored by the 2026-09-10 coverage review and deliberately not filed: they can still change underneath an implementation. moho currently implements **1 of the 12 drafts** (`chathistory`).
Salastil added the featureprotocol labels 2026-09-10 15:45:08 -04:00
Salastil removed the protocol label 2026-09-10 15:53:24 -04:00
Author
Owner

Done in nobilis d271fb7.

A message over the line limit goes as a multiline batch, and where the network has no multiline the pieces go as separate messages - still better than the server cutting the end off. Inbound batches are reassembled, so a paragraph somebody sent as one thing arrives as one thing.

Verified against testnet.ergo.chat, which offers 40 capabilities and granted 21 of them in one line. A 659-byte send left as a batch and came back byte-identical as one message.

Three things only a real server was going to catch, all fixed:

  • BATCH is a parsed variant in the irc crate, not a raw command, so the arm written for it never fired.
  • The batch type comes back uppercased (DRAFT/MULTILINE), so an exact comparison meant the batch was never opened and every piece fell through as its own message.
  • The split broke at a space and trimmed both sides, and pieces rejoin with nothing between them - so 659 bytes arrived as 658 with two words run together at the seam. That the pieces rejoin to exactly the message is now a test.
Done in nobilis [d271fb7](https://git.salastil.com/Salastil/nobilis/commit/d271fb7). A message over the line limit goes as a multiline batch, and where the network has no multiline the pieces go as separate messages - still better than the server cutting the end off. Inbound batches are reassembled, so a paragraph somebody sent as one thing arrives as one thing. **Verified against testnet.ergo.chat**, which offers 40 capabilities and granted 21 of them in one line. A 659-byte send left as a batch and came back **byte-identical as one message**. Three things only a real server was going to catch, all fixed: - `BATCH` is a parsed variant in the irc crate, not a raw command, so the arm written for it never fired. - The batch *type* comes back uppercased (`DRAFT/MULTILINE`), so an exact comparison meant the batch was never opened and every piece fell through as its own message. - The split broke *at* a space and trimmed both sides, and pieces rejoin with nothing between them - so 659 bytes arrived as 658 with two words run together at the seam. That the pieces rejoin to exactly the message is now a test.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Salastil/moho#158