![](/img/trans.png)
[英]Disabling login and register tab of converse.js, and connecting converse.js with openfire
[英]connecting converse.js with fastpath in openfire
我已經使用 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 中
Openfire 的 FastPath 是 XMPP 擴展XEP-0142: Workgroup Queues 的實現。 據我所知,converse.js(版本 3.3.2,這是我撰寫本文時的最新版本)不支持此擴展。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.