Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
Huntsman #1
Member since Apr 2016 · 42 posts
Group memberships: Members
Show profile · Link to this post
Subject: How to read status of a contact
Hello Alex sir.
Can you help me to read status of a contact.

Thank you
Avatar
Alex #2
Member since Feb 2003 · 4296 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Status comes with the presence.

  1. pres.Status
Avatar
Huntsman #3
Member since Apr 2016 · 42 posts
Group memberships: Members
Show profile · Link to this post
its only can used on

  1. Private Sub OnPres(Byval sender as Object, Byval pres As Presence)
  2.    Dim status As String = pres.Status
  3. End Sub

but how to read status of a contact in another sub or another Form.
This post was edited 2 times, last on 2016-11-21, 13:28 by Alex.
Avatar
Alex #4
Member since Feb 2003 · 4296 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
That's up to you.
Populate a dictionary from the event and make it accessible to your other code.

Alex
Avatar
Huntsman #5
Member since Apr 2016 · 42 posts
Group memberships: Members
Show profile · Link to this post
My xmppclient is on Form1 and i make a new Form2
and code in form2

  1. Private _Status As String = String.Empty
  2. Sub New(Byval status As String)
  3. _Status = status

i want to get status on Form2 from Form1's socket.

can you tell me how?
Avatar
Alex #6
Member since Feb 2003 · 4296 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
As I said before, put the status of all your users to a collection and make it global accessible to all your forms as a static or any other singleton patterns.
If would suggest to do the same with the XmppClient object when you need it on multiple forms.
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:
Forum: agsXMPP RSS