public final class MessageRetractionManager
extends org.jivesoftware.smack.Manager
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.| Modifier and Type | Method and Description |
|---|---|
static void |
addRetractionElementToMessage(OriginIdElement retractedMessageId,
org.jivesoftware.smack.packet.MessageBuilder carrierMessageBuilder)
Append a
RetractElement wrapped inside a FasteningElement which contains
the Origin-ID of the message that will be retracted to the given MessageBuilder. |
void |
announceSupport()
Announce support for Message Retraction to the server.
|
static MessageRetractionManager |
getInstanceFor(org.jivesoftware.smack.XMPPConnection connection) |
void |
retractMessage(OriginIdElement retractedMessageId)
Retract a message by appending a
RetractElement wrapped inside a FasteningElement which contains
the Origin-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.
|
public static MessageRetractionManager getInstanceFor(org.jivesoftware.smack.XMPPConnection connection)
public static void setEnabledByDefault(boolean enabled)
enabled - enabledpublic void announceSupport()
public void stopAnnouncingSupport()
public static void addRetractionElementToMessage(OriginIdElement retractedMessageId, org.jivesoftware.smack.packet.MessageBuilder carrierMessageBuilder)
RetractElement wrapped inside a FasteningElement which contains
the Origin-ID of the message that will be retracted to the given MessageBuilder.retractedMessageId - OriginID of the message that the user wants to retractcarrierMessageBuilder - message used to transmit the message retraction to the recipientpublic void retractMessage(OriginIdElement retractedMessageId) throws org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
RetractElement wrapped inside a FasteningElement which contains
the Origin-ID of the message that will be retracted to a new message and send it to the
server.retractedMessageId - OriginID of the message that the user wants to retractSmackException.NotConnectedException - in case the connection is not connected.java.lang.InterruptedException - if the thread gets interrupted.