openfire - How to query a User and his subscriptions via XMPP (smack API) -


i'm working on openfire server have different user , 4 possible subcriptions topics. want show topics subscribed on start of client.

is there way search subscriptions user have via smac (xmpp) ?

you should able use pubsubmanager (<- smack api doc link) subscriptions , nodes. below uses pubsubmanager list of subscriptions , use list subscription ids:

try {     pubsubmanager manager = new pubsubmanager(xmppclient.connection);     list<subscription> listsubs = manager.getsubscriptions();     for(int = 0; < listsubs.size(); i++)     {         system.out.println(listsubs.get(i).getid());     } } catch(xmppexception e) {     system.out.println(e.getmessage()); } 

simple example print ids of subscriptions connection subscribed to. xmppclient name of smack xmppclient instance. however, if need nodes , specific node information can nodes ids using manager , node info using node class. check documentation, can pretty need subscription nodes that.

hope helps!


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -