igniterealtime/REST-API-Client

How to add contcat in Roster without sending and accepting subscription request

Closed this issue · 2 comments

Hello,
Thanks for great source code.
I have download and import the source code in eclipse

I want to implement adding contact in Roster without sending and receiving subscription request in our application,

is there any way to implement this task ??
please reply me if you know any solution.

To - Reader
Thanks for reading an Issue

Redor commented

I think you can create a shared group in Openfire (with everyone). So everyone will be in a roster of other and you don't need to implement something.

i have solved it using Rest API. Now i able to create users and add contacts for individual user without send and accept request

Only make sure that don't use IP while subscription using RestAPI use server's PC name if your server is localhost

RosterItemEntity rosterItemEntity = new RosterItemEntity("user1@domain or pc name", "user1", 3);
restApiClient.addRosterEntry("user2", rosterItemEntity);

RosterItemEntity rosterItemEntity = new RosterItemEntity("user2@domain or pc name", "user2", 3);
restApiClient.addRosterEntry("user1", rosterItemEntity);