Hi, The XEP-0428 annotation only tells you that a specific part of the message was added so that clients that don't understand a specification still can show a message that is close to the original message meaning (even if not the same). What clients do with it, especially how, if or when that fallback part is displayed, is not specified. This is because the content of the fallback might still be usable even if the specification is supported. XEP-0428 fallback annotation is not meant to say "if you know specification X, replace this part with what it provides". There is no direct relation between the fallback element and any other extension element in the stanza, neither by order nor in a different way. If a specification, like a file sharing specification, wanted to specify that it's meant to be injected in a specific point of the body, they would need to do so independent of the fallback element, e.g. though something like <file-sharing insert-at="22" />. XEP-0477 and XEP-0066 both don't provide means to do that. For XEP-0066 that makes sense because it does not make any statements about what to do with the URI and so, if it was to say "insert in the body at position X" or "replace the URI at position X length Y", that would be equivalent of just putting the URI in the body at that position. For SFS, that was a deliberate decision to not require clients to display mixed content, which is often non-trivial and comes with all sorts of downsides and unflexibilities when it comes to user interface design. When a picture is injected into the body, there would also suddenly be dozens of questions on the how that should look like (Look at the options HTML or a word processor give you for this). Your example: "before: $photo1; after: $photo2" I hope that "$photo1" is not verbatim, but rather a URI. Otherwise the fallback would be entirely useless to clients that render it. Just wanted to clarify that, because I believe you misunderstood fallback as a "replace here", in which case a placeholder like "$photo1" would potentially make sense. One way to do this with SFS would be: <message> <body>before: https://...; after: https://...</body> <fallback for='urn:xmpp:sfs:0'><body/></fallback> <file-sharing id="1"> <file> <desc>before</desc> <!-- ... --> </file> <sources><!-- ... --></sources> </file-sharing> <file-sharing id="2"> <file> <desc>after</desc> <!-- ... --> </file> <sources><!-- ... --></sources> </file-sharing> </message> The description of a shared file goes into the <file-sharing> and the whole body becomes a fallback. It is then up to the receiving client if they display the "before" and "after" before the picture, below it, as a title or in a different way, but the meaning is what gets across. Regarding your multiple reply example: Nowhere in XEP-0461 does it suggest you could use it to reply to multiple messages. The wording is always very singular. Further, it also doesn't make huge assumptions in how a reply is rendered. I believe many clients will put the information that a message is a reply above the message content, but nothing would prevent a client from displaying it below, side-by-side, or in a different way I haven't considered yet. The intended way to reply to two different messages with XEP-0461 is to send two messages. If XEP-0428, XEP-0066 or any other specification is unsuitable for what you want to do with it, that doesn't automatically mean it's useless. You do seem to have very specific goals in mind and it might well be that our current specification suite is not good for that. Marvin On Sun, 2026-11-29 at 22:50 +0000, snit--- via Standards wrote:
Hello,
On Nov 29, 2026, 21:10:21, "Marvin W. via Standards" <standards@xmpp.org> wrote:
A message can't have a fallback element with `for="jabber:x:oob"`, because neither XEP-0066 nor any other document specify this or tell what this would mean. Given that the existence of the oob tag on a message has also no specified meaning other than "communicate a URI", I also wouldn't know what a reasonable rule for this could look like. Further, XEP-0066 also does not specify how or if multiple URIs can be communicated in a single message (it does however specify an optional description for the resource identified by the URI).
I've already seen this in the wild, i.e. in Monocles. I hadn't thought there'd even be much to specify. Why would the protocol tell me what I need to be doing with a fallback range? OOB tells me that a URI was conveyed, and the fallback range tells me what the compatibility fallback was, but is it not my job to figure out how to show these aspects to the user?
If there really does need to be explicit specification for every single specification that wishes to use a fallback, then this should _really_ be specified in 0428. Though, either way, I already opened a PR earlier to document fallbacks with OOB, because it surprised me it wasn't already documented. I just copied the wording of replies, which also doesn't actually mandate anything beyond "use the namespace", exactly as I'd expect.
If a message has two SFS in them and a body with two links to the files, the fallback element could be used (because XEP-0447 describes this). In that case it doesn't matter if you put a single fallback element with the whole body, a fallback element with two body start-to- end elements or two fallback elements each with a body start-to- end: In all cases you are indicating to recipient clients that the body is only for those that don't support SFS. There is no concept in XEP-0447 of a client that supports SFS partially and e.g. only the first file of a message or only those with disposition inline.
Right, I'm not talking about clients that don't support SFS, or some really broken client that somehow only "partially" supports it. If I send two SFS elements and two fallback elements, one for each SFS element, a recipient which _does_ support SFS properly currently has no way of telling which fallback applies to which SFS element. The recipient only knows that there's two fallbacks, and that both apply to some arbitrary SFS element, but not which fallback corresponds to which SFS element.
For example, if a client intersperses the media fallbacks within normal body text (i.e. "before: $photo1; after: $photo2"), there's nothing I can do to actually tell the user that $photo1 is the "before" picture, and $photo2 is the "after" picture, just that there ARE pictures in those locations. Another example: if a client allows multi-reply messages (I couldn't find anything against this use- case), then it can't use fallback ranges to determine where in the message to place each reply.
As far as I can tell, the only solution to this at the moment is to pray and hope the sender formed their plaintext body in an exact known format I can parse for, and then ignore the fallback ranges entirely so I can just figure it out myself... which obviously breaks if those prayers aren't answered. So it seems my options are: * implement a very fragile parser running on hopes and dreams * use the fallback element, knowing that it only gives half the information needed to be useful here * do both and get the worst of both worlds, resulting in a horrible user experience that seems to degrade entirely at random
This feels unacceptable to me. What's the point of the XEP if it doesn't actually tell me the information I need for it to be useful? Especially when the fix here is as simple as adding a sentence about how the order of the fallback elements must match the order of the elements they correspond to... or, I don't know, adding an index attribute or something. I guess, worst case scenario, I assume the current Monocles behavior of sending elements in order was intentional and do the same myself. _______________________________________________ Standards mailing list -- standards@xmpp.org To unsubscribe send an email to standards-leave@xmpp.org