use of org.jivesoftware.smackx.message_retraction.element.RetractElement in project Smack by igniterealtime.
the class MessageRetractionManager method addRetractionElementToMessage.
/**
* Append a {@link RetractElement} wrapped inside a {@link FasteningElement} which contains
* the {@link OriginIdElement Origin-ID} of the message that will be retracted to the given {@link MessageBuilder}.
*
* @param retractedMessageId {@link OriginIdElement OriginID} of the message that the user wants to retract
* @param carrierMessageBuilder message used to transmit the message retraction to the recipient
*/
public static void addRetractionElementToMessage(OriginIdElement retractedMessageId, MessageBuilder carrierMessageBuilder) {
FasteningElement fasteningElement = FasteningElement.builder().setOriginId(retractedMessageId).addWrappedPayload(new RetractElement()).build();
fasteningElement.applyTo(carrierMessageBuilder);
}
Aggregations