Project

General

Profile

How to check if a user has subscribed a node or not?

Peter Tian
Added almost 4 years ago

How can I check if a user has subscribed a node or not with Java?


Replies (3)

(1)
Avatar?id=6023&size=32x32

Added by Artur Hefczyc TigaseTeam almost 4 years ago

Could you please provide more details? what do you mean by node?

(1)

Added by Peter Tian almost 4 years ago

A node is a section created on Tigase Server. And users can subscribe to it. When some messages are published to it. Tigase Server will publish the messages to the subscribers.

I need to implement a function.

When a user login, the system need to check wheter the user has subscribed the node or not.

If the user hasn't subscribed it, the system need to subscribe the node for the user first.

By using the following API:

tigase.jaxmpp.core.client.xmpp.modules.pubsub.PubSubModule

public void subscribe(BareJID pubSubJID, String nodeName, JID subscriberJID, SubscriptionAsyncCallback callback)

    throws JaxmppException {

subscribe(pubSubJID, nodeName, subscriberJID, null, (AsyncCallback) callback);

}

Thanks for the help!

(1)

Added by Peter Tian almost 4 years ago

My workmate has found a solution for me:

http://xmpp.org/extensions/xep-0060.html#owner-subscriptions-retrieve.

Thanks anyway.

    (1-3/3)