Class MessageFasteningManager
java.lang.Object
org.jivesoftware.smack.Manager
org.jivesoftware.smackx.message_fastening.MessageFasteningManager
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, call
setEnabledByDefault(boolean)
(default true).
To fasten a payload to a previous message, create an FasteningElement
using the builder provided by
FasteningElement.builder()
.
You need to provide the OriginIdElement
of the message you want to reference.
Then add wrapped payloads using FasteningElement.Builder.addWrappedPayloads(List)
and external payloads using FasteningElement.Builder.addExternalPayloads(List)
.
If you fastened some payloads onto the message previously and now want to replace the previous fastening, call
FasteningElement.isRemovingElement()
.
Once you are finished, build the FasteningElement
using FasteningElement.Builder.build()
and add it to
a stanza by calling FasteningElement.applyTo(MessageBuilder)
.- See Also:
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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
Stop announcing support for Message Fastening.Methods inherited from class org.jivesoftware.smack.Manager
connection, getAuthenticatedConnectionOrThrow, schedule, schedule, scheduleBlocking
-
Field Details
-
NAMESPACE
- See Also:
-
-
Method Details
-
getInstanceFor
-
setEnabledByDefault
Enable or disable auto-announcing support for Message Fastening. Default is enabled.- Parameters:
enabled
- enabled
-
announceSupport
Announce support for Message Fastening via Service Discovery. -
stopAnnouncingSupport
Stop announcing support for Message Fastening.
-