multiline: Specify behavior with respect to formatting.#499
multiline: Specify behavior with respect to formatting.#499progval wants to merge 5 commits intoircv3:masterfrom
Conversation
Tthis is the only way to format the fallback for multiline-unaware clients the same way as for multiline-aware clients
|
lgtm |
|
I'm not sure. This puts a significant burden on clients when interpreting user input and composing a multiline message. |
|
So currently, if someone sends this: then irccloud and the current weechat master will display it like this, because they don't implement this PR: not-bold bold unclear and assuming servers don't do any reformatting, then every client not supporting multiline will get this: so they will display it like this: not-bold bold unclear I understand this can be annoying to implement, but we need to either:
Could we resolve this before weechat ships version 4.0 with draft/multiline support? |
|
Update: weechat released v4.0 without changing its behavior with respect to formatting. |
|
@flashcode As implementer of the multiline spec, could you weigh in on this question? |
|
This has been stalled for some time. I agree that this is the only sensible way of doing it. Any other approach has no sane fallback mechanism. There is however one complication that hasn't been addressed: the current draft says says this about fallback clients:
If the servers don't maintain the lines as sent, this would again lead to different formatting between multiline and non-multiline clients. The only sensible approach to me here seems to be to turn that recommendation into a requirement, i.e. change the 'SHOULD' into a 'MUST'. |
Co-authored-by: JustAnotherArchivist <JustAnotherArchivist@users.noreply.github.com>
|
Actually, the above would apply not only to fallback clients but also to multiline-capable ones; their representation would also change if the server didn't maintain what the author client sent. |
|
And that's fine. Servers have always been allowed to tamper with the text and color codes if they want to. |
|
I suppose so. Would a recommendation to insert formatting reset codes during such rearrangements (if needed) be reasonable? |
|
Have any client developers made an attempt at implementing this suggestion and have any thoughts? |
|
Alternative server-side implementation (not fully fleshed-out wording wise, just an idea at the moment). I'm interested to hear what ircd devs think of this feasibility-wise, etc. For each line in a multiline batch, keep track if there's an unterminated format code. When the server processes a new line in the batch, it will synthesize and inject a Example: Repeat example but replace <0x02> with <0x01>ACTION and <0x0F> with <0x01> for CTCP. As a note, these injected lines could cause the batch being sent to clients to exceed the stated max-lines or max-bytes limits. |
|
What makes it easier for servers to insert |
imo it's not easier to do this server-side, doing it client-side would be easier because there'd be no concerns about impacting send queue and the like (plus a lot of extra overhead on the wire to add one character). However if this is stalled because clients don't want to go through the effort or we're afraid of client fragmentation with some following spec and others not doing the format reset, then there are a lot fewer servers in active development than clients, so having consistency would involve fewer people to do said implementation. |
Inserting and the server inserts to clients who support batch/multiline, which is wrong because they would bold the second line and this: to clients who don't support batch/multiline, which is also wrong for the same reason. |
|
There are literally and objectively only 3 options here: either the server adds formatting codes to subsequent lines for fallback clients, or the non-fallback clients treat formatting as ending at the end of each line, or the behavior is different for fallback and non-fallback clients. If the desire is to have the server handle making sure the formatting is applied to subsequent lines for fallback clients - which I will note is not the one and only objection noted in this thread - then the server will have to wrap lines which become too long as a result of that formatting, which means multiline-concat should have just been clients opting into longer lines in the first place, and then servers could have wrapped lines being sent to fallback clients. (As has been pointed out before, of course, yet multiline has consensus...) |
|
Here's a hot take: we need less server-side message tampering, not more. |
|
Implementing these suggestions in Halloy brings up a complication. For spoiler text (and potentially monospaced text, depending on how the client handles it) two spans directly next to each other are not equivalent to one span covering the same text. The former will reveal the spoiler for each span individually (on user interaction), while the latter will reveal the entire text at once. This means we can't just shove a reset between each received message if we want to preserve message intent, instead it's necessary to check the formatting at the end of the previous message and strip that from the beginning of the current message (if present). |
|
As a server vendor, I'm very skeptical of any proposal that requires server modification of messages here: avoiding server modification was one of the core design goals of multiline in the first place. |
|
@andymandias What you are saying is consistent the spirit of this PR. Can you suggest a better wording? |
|
I agree it is consistent with the spirit of the PR. I don't believe it to be necessarily prohibitive either, just an increase in complexity I felt was worth noting since it wasn't apparent to me on first read (and based on some of the earlier comments I suspect I wasn't the only one). A note along the lines of "Clients will be expected to strip the formatting that carries over from the previous message in the batch in order to reproduce the original formatting spans (e.g. when creating a spoiler text span from multiple messages)." perhaps? |
The goal is so that the text your client sends renders the same regardless of whether the receiving side supports multiline or not. In the fallback case, each line of the multiline batch (including multiline-concat lines) is rendered as its own independent line, and clients historically do not merge formatting between independent lines; it's reset for each line. The suggested wording in this PR serves to emulate that behavior for receiving clients which do support multiline. As a sending client, you should therefore be repeating any formatting that needs to cross protocol line boundaries in each relevant line. As a receiving client, you are free to merge those sections together, and if you have suggested wording for that then feel free to propose it. The option that doesn't work is "do nothing and interpret format codes across protocol line boundaries" because that makes it impossible to specify a rendering that works for all receiving clients. |
This is the only way to format the fallback for multiline-unaware clients the same way as for multiline-aware clients