Custom ad-hoc command

Dmitry Anatolievich
Added over 4 years ago

Hello, everyone.

I am implementing a cutsom ad-hoc command.

And I need to get all items from dynamic roster for user.

Can i get access to dynamic roster items from ad-hoc command and how?

In my case dynamic roster is custom java plugin (like class).

I saw roster's ad-hoc commands from box, but they use user's roster (not dynamic roster):

  1. If user online - from memory:

RosterAbstract rosterUtil = RosterFactory.getRosterImplementation(true)



  1. If user offline - from repository (database):

String rosterStr = repository.getData(ownerBareJID, null, RosterAbstract.ROSTER, null)

Thx and best regards.

Replies (2)


Added by Artur Hefczyc TigaseTeam over 4 years ago

You provided too little information to suggest you a good approach. Have you tried to instantiate class in your ad-hoc command and then directly retrieve the dynamic roster for a user? Good thing about this approach is that it would work regardless the user is online or offline.

Added by Dmitry Anatolievich over 4 years ago

Ok, thx.

I will try.