简体   繁体   English

在 openfire 中将 converse.js 与 fastpath 连接

[英]connecting converse.js with fastpath in openfire

I have installed openfire with the fastpath plugin.我已经使用 fastpath 插件安装了 openfire。 Using the inverse plugin i can redirect the user to the appropriate queue in a workgroup.使用反向插件,我可以将用户重定向到工作组中的相应队列。

Now, i am trying to add converse.js to a page having the same functionality.现在,我正在尝试将 converse.js 添加到具有相同功能的页面。 I can see and chat with the other contacts, but when fastpath tries to put me into a conference with the respective agent (based on a question) i get an error.我可以看到其他联系人并与之聊天,但是当 fastpath 尝试让我与相应的代理(基于一个问题)召开会议时,我收到错误消息。

Here is my js:这是我的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
           }); 

On:在:

_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 is null despite the fact that the message contains the following:尽管消息包含以下内容,但 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"/>

I am missing something but can't quite see it.我错过了一些东西,但看不到它。

Thank you for the help!谢谢你的帮助!


The problem was at the querySelector, replaced问题出在 querySelector 上,已替换

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

with

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

in converse.js在 converse.js 中

Openfire's FastPath is an implementation of the XMPP extension XEP-0142: Workgroup Queues . Openfire 的 FastPath 是 XMPP 扩展XEP-0142: Workgroup Queues 的实现 To the best of my knowledge, converse.js (version 3.3.2, which is the most recent release at the time that I write this), does not support this extension.据我所知,converse.js(版本 3.3.2,这是我撰写本文时的最新版本)不支持此扩展。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM