public final class AttentionManager extends ExtensionManager
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.
xmppSession.addInboundMessageListener(new MessageListener() {
@Override
public void handleMessage(MessageEvent e) {
if (e.isInbound() && e.getMessage().getExtension(Attention.class) != null) {
// Handle attention request.
}
}
});
If you use attentions, enable this manager class, in order to register this extension in service discovery:
xmppSession.getManager(AttentionManager.class).setEnabled(true);
This class is thread-safe.| Modifier and Type | Method and Description |
|---|---|
void |
captureAttention(Jid jid)
Captures the attention of another user.
|
isEnabled, setEnabledpublic final void captureAttention(Jid jid)
jid - The userCopyright © 2014–2015 XMPP.rocks. All rights reserved.