Not logged in. · Lost password · Register
Forum: MatriX RSS
Avatar
yagami #1
Member since Mar 2012 · 30 posts
Group memberships: Members
Show profile · Link to this post
Subject: Why I could not get the JID?
  1. viq = new VcardIq { To = JID + "@xxxx.com", Type = IqType.get };
  2. m_XmppClient.IqFilter.SendIq(viq, vcardResponse);
when I am at vcardResponse,I use
  1. var vc = e.Iq.Query as Matrix.Xmpp.Vcard.Vcard;
But I can not get
  1. string JID = vc.Jid.User;
Why?Is there any way I can get the JID?

Thx~~~
This post was edited on 2012-03-20, 08:59 by Alex.
Avatar
Alex #2
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
not sure if I understand your problem. When my response does not help then please describe your problem in detail.

Quote by yagami:
  1. viq = new VcardIq { To = JID + "@xxxx.com", Type = IqType.get };

a Jid is normally of the format user@server.com. So  JID + "@xxxx.com" makes no sense to me because it would build user@server.com@xxxx.com

Quote by yagami:
when I am at vcardResponse,I use
  1. var vc = e.Iq.Query as Matrix.Xmpp.Vcard.Vcard;
But I can not get
  1. string JID = vc.Jid.User;
Why?Is there any way I can get the JID?

You can get the Jid this vCard belongs to with the following code:
  1. var jid = e.Iq.From;
Avatar
yagami #3
Member since Mar 2012 · 30 posts
Group memberships: Members
Show profile · Link to this post
Sorry~My JID isn't include "@xxx.com",so I need to add the word..

var jid = e.Iq.From;
It's work!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:
Forum: MatriX RSS