Not logged in. · Lost password · Register
Forum: MatriX and XmppDotNet RSS
Avatar
david.felix #1
Member since Jul 2015 · 23 posts
Group memberships: Members
Show profile · Link to this post
Subject: problem with iq query
Hi! I am using the below code to query user picture but its not returning anything and its also not raising error.

  1. Dim re As New VcardIq(New Matrix.Jid(e.RosterItem.Jid), New Matrix.Jid(xc.Username), IqType.Get)
  2. xc.IqFilter.SendIqSynchronous(re, 2000)
  3. If re.Type = IqType.Result Then
  4.     Dim vc As Vcard = TryCast(re.Query, Vcard)
  5.     mt.TileImage = vc.Photo.Image
  6. End If

I know the other way of doing it but i want to use this one because i want to retreive user picture whiles querying roster items.
Please what am i missing?

Thanks
This post was edited on 2015-08-16, 13:53 by Alex.
Avatar
Alex #2
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
this code looks good to me and should work.
I do not suggest to do this synchronous in a loop. So it asynchronous and add the photos to your roster as you retrieve them.

Alex
Avatar
david.felix #3
Member since Jul 2015 · 23 posts
Group memberships: Members
Show profile · Link to this post
Okay. I have decided to use the callback method.

Thanks a lot.
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: