igniterealtime / REST-API-Client

Java REST API Client for the Openfire to manage Openfire instances by sending an REST/HTTP request to the server
Apache License 2.0
102 stars 62 forks source link

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

Closed rajscet closed 8 years ago

rajscet commented 8 years ago

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 8 years ago

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.

rajscet commented 8 years ago

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);