1

获取名册后,我想发送一条 IQ 获取消息以获取 vCard。如何使用矩阵 vnext 发送具有所需值的 XMPP/XML 数据包?数据包详细信息示例:IQ [ID ='123' type='get' to='foo@10.10.10.11'] VCard [xmlns='vcard-temp' ]

4

1 回答 1

0

这在此处的文档中进行了描述: 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
}  
于 2019-08-30T15:53:36.220 回答