Class MessageRetractionManager
java.lang.Object
org.jivesoftware.smack.Manager
org.jivesoftware.smackx.message_retraction.MessageRetractionManager
Smacks API for XEP-0424: Message Retraction.
To enable / disable auto-announcing support for this feature, call
setEnabledByDefault(boolean).
Auto-announcing is enabled by default.
To retract a message, call retractMessage(OriginIdElement), passing in the Origin ID
of the message to be retracted.-
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddRetractionElementToMessage(OriginIdElement retractedMessageId, MessageBuilder carrierMessageBuilder) Append aRetractElementwrapped inside aFasteningElementwhich contains theOrigin-IDof the message that will be retracted to the givenMessageBuilder.voidAnnounce support for Message Retraction to the server.static MessageRetractionManagergetInstanceFor(XMPPConnection connection) voidretractMessage(OriginIdElement retractedMessageId) Retract a message by appending aRetractElementwrapped inside aFasteningElementwhich contains theOrigin-IDof the message that will be retracted to a new message and send it to the server.static voidsetEnabledByDefault(boolean enabled) Enable or disable auto-announcing support for Message Retraction.voidStop announcing support for Message Retraction.Methods inherited from class org.jivesoftware.smack.Manager
connection, getAuthenticatedConnectionOrThrow, schedule, schedule, scheduleBlocking
-
Method Details
-
getInstanceFor
-
setEnabledByDefault
Enable or disable auto-announcing support for Message Retraction. Default is disabled.- Parameters:
enabled- enabled
-
announceSupport
Announce support for Message Retraction to the server. -
stopAnnouncingSupport
Stop announcing support for Message Retraction. -
addRetractionElementToMessage
public static void addRetractionElementToMessage(OriginIdElement retractedMessageId, MessageBuilder carrierMessageBuilder) Append aRetractElementwrapped inside aFasteningElementwhich contains theOrigin-IDof the message that will be retracted to the givenMessageBuilder.- Parameters:
retractedMessageId-OriginIDof the message that the user wants to retractcarrierMessageBuilder- message used to transmit the message retraction to the recipient
-
retractMessage
public void retractMessage(OriginIdElement retractedMessageId) throws SmackException.NotConnectedException, InterruptedException Retract a message by appending aRetractElementwrapped inside aFasteningElementwhich contains theOrigin-IDof the message that will be retracted to a new message and send it to the server.- Parameters:
retractedMessageId-OriginIDof the message that the user wants to retract- Throws:
SmackException.NotConnectedException- in case the connection is not connected.InterruptedException- if the thread gets interrupted.
-