请求时未给出 XMPP 照片类型

发布于 2024-10-01 03:31:34 字数 1535 浏览 1 评论 0原文

我们正在尝试使用传输从我们自己的 ejabberd 服务器实现 facebook 聊天。但是当我们请求联系人照片时,它给出了 binval 但没有提供照片类型。任何人都可以帮我解决这个问题吗?


编辑

为了回答后续问题,这是我发送到服务器的请求:

var imgcard = $iq({ to:name, from:connection.jid, type: 'get', id :'avatar'+name})
    .c('vCard', {xmlns:'vcard-temp' })
connection.sendIQ(imgcard, getImg);

响应是:

<body xmlns="http://jabber.org/protocol/httpbind">
    <iq xmlns="jabber:client"
        to="[email protected]/24581935361290171300602628"
        from="[email protected]" 
        id="[email protected]"
        type="result">
        <vcard xmlns="vcard-temp">
            <desc></desc>
            <photo>
                <binval>/9j/4AAQSkZJRgABAQAAAQABAAD/9sAQwACAQEBAQECAQEBAgICAgIEAwICAgIFBAQDBAY... 
                </binval>
            </photo>
        </vcard>
    </iq>
</body>

我得到了 binval 但没有得到图像类型。谁能告诉我我犯的错误吗?

We are trying to implement facebook chat from our own ejabberd server using transports.But when we requested for photo of the contact, it gives binval but not type of photo.Can any one help me out in resolving this issue.


EDIT

In response to the follow-up questions, this is the request I send to the server:

var imgcard = $iq({ to:name, from:connection.jid, type: 'get', id :'avatar'+name})
    .c('vCard', {xmlns:'vcard-temp' })
connection.sendIQ(imgcard, getImg);

The response is:

<body xmlns="http://jabber.org/protocol/httpbind">
    <iq xmlns="jabber:client"
        to="[email protected]/24581935361290171300602628"
        from="[email protected]" 
        id="[email protected]"
        type="result">
        <vcard xmlns="vcard-temp">
            <desc></desc>
            <photo>
                <binval>/9j/4AAQSkZJRgABAQAAAQABAAD/9sAQwACAQEBAQECAQEBAgICAgIEAwICAgIFBAQDBAY... 
                </binval>
            </photo>
        </vcard>
    </iq>
</body>

I get the binval but not image type. Can any one tell the mistake I made?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

岁月染过的梦 2024-10-08 03:31:34

使用 JAXL 库 检索连接帐户的 vCard,我收到以下响应,其中确实有 image/ jpeg 节点附加到它。

[16000] 2010-11-09 23:49:47 - [[XMPPSend]] body
<body rid="5674" sid="41bbdfe522c4e1c3a3e1a4cfe20968f1" xmlns="http://jabber.org/protocol/httpbind"><iq type="get" id="7" from="[email protected]/jaxl.1289375373_ba14f160_494AE079BF19C"><vCard xmlns="vcard-temp"/></iq></body>

[16000] 2010-11-09 23:49:48 - [[XMPPGet]]
<body sid="41bbdfe522c4e1c3a3e1a4cfe20968f1" rid="5674" xmlns="http://jabber.org/protocol/httpbind"><iq from="[email protected]" to="[email protected]/jaxl.1289375373_ba14f160_494AE079BF19C" id="7" type="result"><vCard xmlns="vcard-temp"><FN>Abhinav Singh</FN><PHOTO><TYPE>image/jpeg</TYPE><BINVAL></BINVAL></PHOTO></vCard></iq></body>

您从 Facebook 聊天服务器到底得到什么响应?

Using JAXL library to retrieve vCard for connected account, I get following response back which does have <TYPE>image/jpeg</TYPE> node attached to it.

[16000] 2010-11-09 23:49:47 - [[XMPPSend]] body
<body rid="5674" sid="41bbdfe522c4e1c3a3e1a4cfe20968f1" xmlns="http://jabber.org/protocol/httpbind"><iq type="get" id="7" from="[email protected]/jaxl.1289375373_ba14f160_494AE079BF19C"><vCard xmlns="vcard-temp"/></iq></body>

[16000] 2010-11-09 23:49:48 - [[XMPPGet]]
<body sid="41bbdfe522c4e1c3a3e1a4cfe20968f1" rid="5674" xmlns="http://jabber.org/protocol/httpbind"><iq from="[email protected]" to="[email protected]/jaxl.1289375373_ba14f160_494AE079BF19C" id="7" type="result"><vCard xmlns="vcard-temp"><FN>Abhinav Singh</FN><PHOTO><TYPE>image/jpeg</TYPE><BINVAL></BINVAL></PHOTO></vCard></iq></body>

What exactly do you get back in response from facebook chat servers?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文