Class MessageRetractionManager
- java.lang.Object
-
- org.jivesoftware.smack.Manager
-
- org.jivesoftware.smackx.message_retraction.MessageRetractionManager
-
public final class MessageRetractionManager extends Manager
Smacks API for XEP-0424: Message Retraction. To enable / disable auto-announcing support for this feature, callsetEnabledByDefault(boolean). Auto-announcing is enabled by default. To retract a message, callretractMessage(OriginIdElement), passing in theOrigin IDof the message to be retracted.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidaddRetractionElementToMessage(OriginIdElement retractedMessageId, MessageBuilder carrierMessageBuilder)Append aRetractElementwrapped inside aFasteningElementwhich contains theOrigin-IDof the message that will be retracted to the givenMessageBuilder.voidannounceSupport()Announce 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.voidstopAnnouncingSupport()Stop announcing support for Message Retraction.-
Methods inherited from class org.jivesoftware.smack.Manager
connection, getAuthenticatedConnectionOrThrow, schedule, schedule, scheduleBlocking
-
-
-
-
Method Detail
-
getInstanceFor
public static MessageRetractionManager getInstanceFor(XMPPConnection connection)
-
setEnabledByDefault
public static void setEnabledByDefault(boolean enabled)
Enable or disable auto-announcing support for Message Retraction. Default is disabled.- Parameters:
enabled- enabled
-
announceSupport
public void announceSupport()
Announce support for Message Retraction to the server.
-
stopAnnouncingSupport
public void 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, java.lang.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.java.lang.InterruptedException- if the thread gets interrupted.
-
-