After fetching roster, I want to send a IQ get message to get vCard. How to send the a XMPP/XML packet with desired value using matrix vnext? Example of packet details: IQ [ID ='123' type='get' to='foo@10.10.10.11'] VCard [xmlns='vcard-temp' ]
Asked
Active
Viewed 94 times
1 Answers
0
This is described in the docs here: https://matrix-xmpp.io/docs/info-query
// construct the iq query
var vcardRequest = new VcardIq { Type = IqType.Get, To = "bob@example.com" };
// send the request and await the resposne
var resultIq = await xmppClient.SendIqAsync(vcardRequest);
// check for success or failure
if (resultIq.Type == IqType.Result)
{
// server returned a result (sucsess)
// => process the vCard here
}
else if (resultIq.Type == IqType.Error)
{
// server returned an error
// => handle error
}

Alex
- 4,066
- 2
- 19
- 21