On 2025/01/18 10:46, Nicolas Cedilnik wrote:
In example 4 there is already a `<fallback>` element.

Concerning setting the body to "/me retracted this message", using `/me` is a nice touch, but the rest doesn't make sense to me, since that is not the message being retracted, but rather a previous one, and non-supporting clients have no way of knowing which one that was. So I think it can only be something like "/me retracted a previous message, but it's unsupported by your client."

You can use both the fallback and a XEP-0308 <replace>, so that non XEP-0424-supporting (but XEP-0308-supporting) clients will effectively edit the deleted message. It works nicely in practice. However, this is not strictly legal by XEP-0308 if this is not the last message that was sent. Also, YMMV but retracting the last message that was sent is the most common use case, for me at least. ("oops, wrong chat" and "oops, what I just posted actually didn't make any sense, forget about it")


This is clever, but then what about clients that support neither retractions nor corrections?

In this case you'll see the message that should have been retracted as well as an additional /me message and it won't necessarily be clear that the /me message applies to a different message further up in the chat history.

For example:

JC: I prefer XEP-0136 to XEP-0313
Dave: I can't believe what I just read.
** JC retracted this message

Potential remedies:

* Change to "/me retracted a message" (instead of "this")
* Make the <body> empty instead


Example stanza:

<message type="chat" from="juliet@aim.shakespeare.lit/slidge" to="romeo@montague.lit"> <body>/me retracted this message</body> <active xmlns="http://jabber.org/protocol/chatstates" /> <store xmlns="urn:xmpp:hints" /> <fallback xmlns="urn:xmpp:fallback:0" for="urn:xmpp:message-retract:1" /> <retract xmlns="urn:xmpp:message-retract:1" id="old_msg_id" /> <replace id='old_msg_id' xmlns='urn:xmpp:message-correct:0' /> </message>

Given that the <retract> is used as a fallback, shouldn't that be indicated inside the fallback element?

For example:

<message type='chat' to='lord@capulet.example' id='retract-message-1'>
  <retract id="wrong-recipient-1" xmlns='urn:xmpp:message-retract:1'/>
  <body>/me retracted a message</body>
  <replace id='old_msg_id' xmlns='urn:xmpp:message-correct:0' />
  <store xmlns="urn:xmpp:hints"/>
  <fallback xmlns="urn:xmpp:fallback:0" for="urn:xmpp:message-retract:1">
    <body />
    <retract xmlns="urn:xmpp:message-retract:1" />
  </fallback>
</message>


I will be slightly more annoying to implement if we switch to using stanza-id instead of origin-id (since XEP-0308 requires message@id which is == origin-id most of the time).

You mean for MUCs? For 1:1 the message id is used.