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 void
addRetractionElementToMessage
(OriginIdElement retractedMessageId, MessageBuilder carrierMessageBuilder) Append aRetractElement
wrapped inside aFasteningElement
which contains theOrigin-ID
of the message that will be retracted to the givenMessageBuilder
.void
Announce support for Message Retraction to the server.static MessageRetractionManager
getInstanceFor
(XMPPConnection connection) void
retractMessage
(OriginIdElement retractedMessageId) Retract a message by appending aRetractElement
wrapped inside aFasteningElement
which contains theOrigin-ID
of the message that will be retracted to a new message and send it to the server.static void
setEnabledByDefault
(boolean enabled) Enable or disable auto-announcing support for Message Retraction.void
Stop 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 aRetractElement
wrapped inside aFasteningElement
which contains theOrigin-ID
of the message that will be retracted to the givenMessageBuilder
.- Parameters:
retractedMessageId
-OriginID
of 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 aRetractElement
wrapped inside aFasteningElement
which contains theOrigin-ID
of the message that will be retracted to a new message and send it to the server.- Parameters:
retractedMessageId
-OriginID
of the message that the user wants to retract- Throws:
SmackException.NotConnectedException
- in case the connection is not connected.InterruptedException
- if the thread gets interrupted.
-