Not logged in. · Lost password · Register
Forum: MatriX and XmppDotNet RSS
Avatar
mrbelk #1
Member since Feb 2017 · 23 posts
Group memberships: Members
Show profile · Link to this post
Subject: Getting additional properties from user
How would I go about getting any additional properties from a user in the OnRosterItem or OnPresence events?

Thanks,
Matthew
Avatar
Alex #2
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Which properties do you refer to?
Avatar
mrbelk #3
Member since Feb 2017 · 23 posts
Group memberships: Members
Show profile · Link to this post
Ones that we define.

The Openfire XMPP server that we're using has a REST API that allows us to supply any number of simple key/value pairs of "extended properties" on users. There is no fixed set of property keys. I guess I just assumed that this was a feature of the XMPP spec.

In my case, I am wanting to add properties to users like "floor," "unit," "room," "bed," "device-type," etc. This system I'm working on is going to be used in a hospital setting and having some additional metadata about the users/devices in the ecosystem will be helpful. I suppose I could always just use the RESTAPI to query the server when I get the JID from the OnRosterItem or the OnPresence events, but if it were somehow contained within the data that's already coming through on the wire that would be ideal.

-Matthew
Avatar
Alex #4
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
I don't know where those properties end up in openfire.

You can check if they get returned in the xml of the user's vCard, or with the roster item.

Alex
Avatar
mrbelk #5
Member since Feb 2017 · 23 posts
Group memberships: Members
Show profile · Link to this post
It doesn't appear to be in the RosterItem object I get in the OnRosterItem event handler. How would I get access to the user's vCard?

Thanks,
Matthew
Avatar
Alex #6
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Look at the MiniClient example here:
https://gitlab.com/matrix-xmpp/samples/blob/master/csharp/…
Avatar
mrbelk #7
Member since Feb 2017 · 23 posts
Group memberships: Members
Show profile · Link to this post
It's not in there. I can just use the REST API from inside the OnRosterItem handler to get those extended properties from openfire.

-Matthew
Avatar
Alex #8
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
OK, you can also ask the Openfire developers if this information is available over XMPP functionality.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters: