Class Replace
- java.lang.Object
-
- rocks.xmpp.extensions.messagecorrect.model.Replace
-
public final class Replace extends Object
The implementation of the<replace/>
element in theurn:xmpp:message-correct:0
namespace.Advertising Support for Message Correction
xmppClient.enableFeature(Replace.NAMESPACE);
Checking if a Message Should be Corrected
Replace replace = message.getExtension(Replace.class); if (replace != null) { String oldMessageId = replace.getId(); // Replace old message with message... }
Correcting a Message
Message correctedMessage = new Message(jid, Message.Type.CHAT, "This is the corrected text"); correctedMessage.addExtension(new Replace(id)); xmppClient.send(correctedMessage);
This class is immutable.
- See Also:
- XEP-0308: Last Message Correction, XML Schema
-
-
Field Detail
-
NAMESPACE
public static final String NAMESPACE
urn:xmpp:message-correct:0- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Replace
public Replace(String id)
- Parameters:
id
- The id of the message which shall be corrected.
-
-