Class MessageFasteningManager
- java.lang.Object
-
- org.jivesoftware.smack.Manager
-
- org.jivesoftware.smackx.message_fastening.MessageFasteningManager
-
public final class MessageFasteningManager extends Manager
Smacks API for XEP-0422: Message Fastening. The API is still very bare bones, as the XEP intends Message Fastening to be used as a tool by other protocols. To enable / disable auto-announcing support for this feature, callsetEnabledByDefault(boolean)
(default true). To fasten a payload to a previous message, create anFasteningElement
using the builder provided byFasteningElement.builder()
. You need to provide theOriginIdElement
of the message you want to reference. Then add wrapped payloads usingFasteningElement.Builder.addWrappedPayloads(List)
and external payloads usingFasteningElement.Builder.addExternalPayloads(List)
. If you fastened some payloads onto the message previously and now want to replace the previous fastening, callFasteningElement.isRemovingElement()
. Once you are finished, build theFasteningElement
usingFasteningElement.Builder.build()
and add it to a stanza by callingFasteningElement.applyTo(MessageBuilder)
.- See Also:
- XEP-0422: Message Fastening
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
NAMESPACE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
announceSupport()
Announce support for Message Fastening via Service Discovery.static MessageFasteningManager
getInstanceFor(XMPPConnection connection)
static void
setEnabledByDefault(boolean enabled)
Enable or disable auto-announcing support for Message Fastening.void
stopAnnouncingSupport()
Stop announcing support for Message Fastening.-
Methods inherited from class org.jivesoftware.smack.Manager
connection, getAuthenticatedConnectionOrThrow, schedule, schedule, scheduleBlocking
-
-
-
-
Field Detail
-
NAMESPACE
public static final java.lang.String NAMESPACE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstanceFor
public static MessageFasteningManager getInstanceFor(XMPPConnection connection)
-
setEnabledByDefault
public static void setEnabledByDefault(boolean enabled)
Enable or disable auto-announcing support for Message Fastening. Default is enabled.- Parameters:
enabled
- enabled
-
announceSupport
public void announceSupport()
Announce support for Message Fastening via Service Discovery.
-
stopAnnouncingSupport
public void stopAnnouncingSupport()
Stop announcing support for Message Fastening.
-
-