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 ID
of the message to be retracted.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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
.void
announceSupport()
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
stopAnnouncingSupport()
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 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.
-
-