public final class Attention extends Object
<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);
Message message = new Message(jid, Message.Type.HEADLINE);
message.addExtension(Attention.INSTANCE);
xmppClient.send(message);
This class is immutable.
public static final Attention INSTANCE
<attention/> element.public static final String NAMESPACE
Copyright © 2014–2017 XMPP.rocks. All rights reserved.