Get user real name

Hello,

I’m currently building a chat application on Android and I’ve been able to receive messages from users. I’d like to display something like “You received a text from {USER}”, where “{USER}” would be the real name of the user. By “real name”, I mean the field "Name: " on the “Edit properties” screen of OpenFire… (See attached file).

However, I only receive the username and I didn’t find any way (or help over the internet) to be able to get that.

Thanks

No way. It’s an internal value.

It could also confuse users to see real instead of roster names.

I have no idea how ‘real’ these names in your Openfire servet really are. If you really want to return them then you may want to write am Openfire plugin to do this. I wrote an ofuser2vcard plugin some years ago - not sure if it can help you.

Hi

OK, then I’m gonna explain what I want to do more clearly to see what’s the best option. Actually, the chat is only a part of my application. You can do other things with it… The main point is that an user is not just an username, it has other properties like an avatar, a position (latitude and longitude, etc…).

I think there are two options to achieve these properties management:

  • Manage these infos with OpenFire

  • Manage these infos in a separate database table and use a foreign key to make the link

I know how to do the second option but it means that I can’t use the XMPP connection to get all the info. I already have a REST API so I could use it, it is not a problem, but I’m thinking that it would be more efficient to have these infos managed by OpenFire and sent in some way by it. The problem is that I really don’t know what’s the best approach for this.

Could you give me some advices?

Thanks

Manage these infos in a separate database table and use a foreign key to make the link

And the foreign key would be simply the bare JID of the user.

I know how to do the second option but it means that I can’t use the XMPP connection to get all the info
Sure you can use XMPP to get the info. Just write a XMPP component (internal to openfire or external) that allows to be queried by users. Authentication is done by XMPP, authorization must be done by you.

Sure you can use XMPP to get the info. Just write a XMPP component (internal to openfire or external) that allows to be queried by users. Authentication is done by XMPP, authorization must be done by you.

That sounds interesting. I found this post : https://community.igniterealtime.org/docs/DOC-1924

Is it still up to date? Can I use it (because I see it is in the Tinder section so I’m wondering if it concerns what I need). If not, do you have some documentation about how to developp such a component?

However, by looking over the Internet, I found the notion of vCard. Apparently it is supported by OpenFire and it seems to correspond to what I’m looking for, isn’t it? Couldn’t I use that instead?

Thanks

The vCard is managed by the user. Your App would need to trust it or salt the user password to make sure that the user does not know the real password. Then you can use it.

Hi,

I checked a bit vCard but finally it is not what I want… At some point of time, in the application, a SQL request must be done on some data (user data). As these data are store in just one field in the ofvcard table, it is not reliable to execute SQL query on it. For example, I cannot do something like that:

SELECT * FROM [TABLE] WHERE field >= value OR field <= other_value

So what I need is to be able to access another database table through the XMPP connection. Flow told me about internal/external component but the documentation on that matter is very poor so I don’t really know how I can proceed. I don’t want to have part of my application using a REST API and another part using XMPP connection.