【问题标题】:connecting converse.js with fastpath in openfire在 openfire 中将 converse.js 与 fastpath 连接
【发布时间】:2018-07-15 07:13:11
【问题描述】:

我已经用 fastpath 插件安装了 openfire。 使用反向插件,我可以将用户重定向到工作组中的适当队列。

现在,我正在尝试将 converse.js 添加到具有相同功能的页面中。我可以看到其他联系人并与之聊天,但是当 fastpath 试图让我与相应的代理(基于一个问题)进行会议时,我收到了一个错误。

这是我的js:

  converse.initialize({
            bosh_service_url: 'http://chat.domain.com:7070/http-bind/',
            show_controlbox_by_default: true,
            allow_muc_invitations: true,
            keepalive: true,
            debug: true,
            allow_non_roster_messaging: true,
            allow_contact_requests: true,
            auto_join_on_invite: true,
            roster_groups: true,
            jid: 'user@chat.domain.com',
            password: 'password',
            auto_login: true,
            auto_subscribe: true
           }); 

开启:

_converse.onDirectMUCInvitation = function (message) {
 var x_el = message.querySelector('x[xmlns="jabber:x:conference"]'),
        from = Strophe.getBareJidFromJid(message.getAttribute('from')),
        room_jid = x_el.getAttribute('jid'),
        reason = x_el.getAttribute('reason');}

尽管消息包含以下内容,但 x_el 为空:

<message xmlns="jabber:client" 
from="pjiw6d129@conference.chat.domain.com" 
to="user@chat.domain.com/converse.js-60521038">
<workgroup xmlns="http://jabber.org/protocol/workgroup" jid="test@workgroup.chat.domain.com"/>
<session xmlns="http://jivesoftware.com/protocol/workgroup" id="pjiw6d129"/>
<x xmlns="http://jabber.org/protocol/muc#user">
    <invite from="test@workgroup.chat.domain.com">
        <reason>Please join me for a chat.</reason>
    </invite>
</x>
<x xmlns="jabber:x:conference" jid="pjiw6d129@conference.chat.domain.com"/>

我遗漏了一些东西,但看不清楚。

感谢您的帮助!


问题出在querySelector,被替换了

room_jid = x_el.getAttribute('jid'),
reason = x_el.getAttribute('reason');}

room_jid = message.getElementsByTagName('x')[1].getAttribute('jid'),
reason = message.getElementsByTagName('x')[0].getAttribute('reason');

在 converse.js 中

【问题讨论】:

    标签: javascript openfire strophe converse.js


    【解决方案1】:

    Openfire 的 FastPath 是 XMPP 扩展 XEP-0142: Workgroup Queues 的实现。据我所知,converse.js(版本 3.3.2,这是我撰写本文时的最新版本)不支持此扩展。

    【讨论】:

    • 我只是想用 converse 作为 XMPP 客户端。它不需要支持 XEP-0142。
    猜你喜欢
    • 2015-04-11
    • 2015-04-01
    • 2014-11-24
    • 2014-08-15
    • 2021-11-03
    • 2013-07-26
    • 2015-05-29
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多