Not logged in. · Lost password · Register
Forum: MatriX and XmppDotNet RSS
Avatar
sebnet #1
Member since Sep 2012 · 2 posts
Group memberships: Members
Show profile · Link to this post
Subject: Check status
Hi, I want to get the status of one of my contacts, if he is available or not, how should I do it?
Thanks.
Avatar
Alex #2
Member since Feb 2003 · 4447 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
  • You get your contacts in the OnRosterItem event
  • You consider all contacts as offline by default
  • You get the presence of online contacts in the OnPresence event.
Avatar
sebnet #3
Member since Sep 2012 · 2 posts
Group memberships: Members
Show profile · Link to this post
Thank you but, I don't want to suscribe to the presence event. I dont want to consume every time someone changes his status.

I need to see in any point of time if someone is available and his status (away, busy, etc).

Another library I was using has a method: PresenceManager.IsAvailable(JID) . As matrix has support for messenger and facebook, I'd like to switch.

How can I simulate somehting like that with matrix?
Avatar
Alex #4
Member since Feb 2003 · 4447 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
This is how XMPP works. What the other library does is just adding all presences to a dictionary where you can look them up.
So add a dictionary to your code and fill or update it from the OnPresence event.

Alex
Avatar
Justin.Toman #5
Member since Sep 2012 · 3 posts
Group memberships: Members
Show profile · Link to this post
Which member on the PresenceEventArgs has the status information needed to determine online/offline/busy/etc? The only relevant sounding properties are all marked as OPTIONAL in their descriptions.

I want to do something like:

MyContact.OnlineStatus = e.Presence.OnlineStatus;
Avatar
Alex #6
Member since Feb 2003 · 4447 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
e.Presence.Show
Avatar
Justin.Toman #7
Member since Sep 2012 · 3 posts
Group memberships: Members
Show profile · Link to this post
Thank you!
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: