How to integrate with OpenFire XMPP server to receive roster info for users? - xmpp

I need to create small auxiliary server that is part/integrates with OpenFire server in order to get roster for a given user.
I was looking for some plugin/api call that given the user JID to return his contacts and their online status.
All-in-all I may end up changing OpenFire's code but I was hoping that there is a easier solution

All though the links provided by Manasi would work for you. However those links refers to user service plugin which has been depricated by openfire.
They recommend to use REST API plugin.
You'll see list of all plugins here.
You should read about retrieving user roster and their presence .

You could try using the user service plugin of openfire that returns a host of information of the user as well as its rosters.
for documentation click here.
You can get the roster information by this url.

Related

XMPP: How to query specific rosters presence

Whats is XAMP stanza for get specific(single or multiple) roster presence instead of all ?
I'm using Strophe.js for XAMPP(openfire) communication. As per Openfire didn't provide support for message status(read, received and read) at server side so, I have implemented some extra logic for make it work.
I'm retrieving my rosters by ajax call through querying Openfire db one self and returning rosters, also roster search functionality here. Problem is when I search and get roster through API so I can't get presence of roster. I want presence only for search result rosters instead all users through Strophe.js(XAMP stanza).
I found a partial solution, it's only working when the roster is online. we can take default user status offline and we can update online presence response.
<presence to="JID" type="probe" xmlns="jabber:client"/>

Ejabberd: How to limit the fetching of jabber user directory (JUD)

I'm developing a client jabberd application for mobile(android) using (a)Smack.
Since, in my application, the users are registered by their phone numbers, the application should be able to recognize which contact has a jabber account on the server and suggest him/her for chatting.
After googlling the web I found that there is a jabber user directory (JUD) which I can use to check there is an account for a specific mobile number or not. (I'm using UserSearchManager).
My questions:
1- It seems that there is no record in JUD for a user who has not updated his vCard yet, so I cannot find him. Is there any solution to check the existence of this kind of users?
2- It seems that by using JUD, everyone outside of my application can fetch some important information of users such as mobile numbers, emails, etc. Is there any solution to limit JUD search engine? (for example, getting only "user field" as a input and returning only "full name field" of existing accounts or other useful limitation).
So by this way, I can recognize which person from the contact list has an account on the server and also other people cannot fetch important information of the exiting users.
Any command or advice is appreciated. Thank you.
I do not think it is possible as default, without customizing ejabberd application code.

Server managed roster in Tigase

Generally in messenger services, user adds or deletes contacts and let knows server about it. Server then takes necessary actions.
However, our requirement is "server decides contacts list, makes roster changes accordingly and clients receives updates about the same". How can we achieve this in Tigase?
There is a dedicated API in the Tigase just for that. It is called a DynamicRoster. Maybe the name is the most accurate. Dynamic because it is managed by the server and it can change any time user requests the roster.
Anyway, there are code examples in the Tigase main code repository. You can have multiple dynamic rosters active at the same time and they can retrieve contacts from different locations.
There is also a roster protocol extension which allows you to keep extra information for the contacts in the dynamic roster such as phone numbers, etc... More info about this o the Tigase.org website in the devel guide section.
Hope this helps.

Facebook Chat limitations

My company develop a product for customer support on Facebook and we want to give the representatives a way to contact the customer via Facebook Chat.
I have read the Chat API documentations and it is not clear whether users MUST be friends on Facebook in order to chat or is it just enough they both installed a Facebook app? more limitations?
any insight will be appreciated.
Thanks in advance for you answers,
Yaniv Hakim
Facebook provides an XMPP port to the outside world while internally it implements MQTT. As per XMPP specs, messaging works between two entities without they being in each other roster list (friend/contact list). However, Facebook seems to have this limitation as part of their own business requirement. I think even GoogleTalk disallows this if two federated entities try to send message to each other without being on the roster list.
In short, yes you can just send the message. You don't need a presence authorization from someone in order to send messages to them (in XMPP world). HOWEVER, some services has a policy of requiring this, despite the fact that this is not mandated by the XMPP specifications.

Best way to integrate an XMPP Server into Webapplication

I'm working on a middle size community project, using php and the php framework symfony2 atm.
We are planning to integrate XMPP as a support chat and premium feature for our users. The users will be able to connect via a webclient and also via normal xmpp clients.
So here are my questions:
About the Rosters: I want to have the users from the friends list listed in the users contact list. I know that this can be done with rosters. But how can I implement this on a simple and stable way? Is there a good Server implementation that can get the users roster out of a sql database like pgsql?
What happens on the client when the roster datas are beeing changed while the user is logged in on the xmpp server?
Can I group the users that are listed in the roster of a user?
Which XMPP server project would you recommend for that kind of project?
Thanks for your help in advance!
most existing XMPP servers support all popular DBRMs. So this should be no problem.
probably nothing when you make the changes directly do the database. So have to find a server where you can initiate a roster push to all connected clients. See also the XMPP RFCs for roster updates.
yes, roster groups are a core feature of XMPP.
You can find a list of XMPP servers here: http://xmpp.org/xmpp-software/servers/ You have to check which servers support pgsql and allow you to update the roster and initiate the roster pushes to connected resources.