public final class Attention
extends java.lang.Object
The implementation of the <attention/>
element in the urn:xmpp:attention:0
namespace.
This feature is known as ‘nudge’ or ‘buzz’ in some non-XMPP IM protocols.
If you want to listen for inbound attention requests, listen for inbound messages and check if they have the Attention
extension.
xmppClient.addInboundMessageListener(e -> {
if (e.getMessage().hasExtension(Attention.class)) {
// Handle attention request.
}
});
You should also enable this feature (preferably before login), in order to register this extension in service discovery:
xmppClient.enableFeature(Attention.NAMESPACE);
Attention requests are sent via a ‘headline’ message:
Message message = new Message(jid, Message.Type.HEADLINE);
message.addExtension(Attention.INSTANCE);
xmppClient.send(message);
This class is immutable.
public static final Attention INSTANCE
The <attention/>
element.
public static final java.lang.String NAMESPACE
urn:xmpp:attention:0
Copyright © 2014–2019 XMPP.rocks. All rights reserved.