strophe.js组邀请处理程序未触发


strophe.js group invite - handler not triggered

我的邀请处理程序有问题。它从不被解雇。我可以看到来自团体的邀请:

<body xmlns='http://jabber.org/protocol/httpbind'>
        <message xmlns="jabber:client" from="epthi_795@conference.188.2.16.19" to="nikoladerikonjic@188.2.16.19">
            <x xmlns="http://jabber.org/protocol/muc#user">
                <invite from="sanjicabjelica@188.2.16.19">
                    <reason>Please join me in conference.</reason>
                </invite>
            </x>
            <x xmlns="jabber:x:conference" jid="epthi_795@conference.188.2.16.19"/>
        </message>
</body>

但未启动on_message处理程序。因为没有定义类型。

当我放置Chat.connection.addHandler(Chat.on_message,null, "message", null,null,null,null);

会显示邀请,但随后所有消息群或聊天都会由它处理。我想我能有

Chat.connection.addHandler(Chat.on_message,null, "message", "chat");
Chat.connection.addHandler(Chat.on_message,null, "message", "groupchat");

用于单独类型的消息。

我要带着这个绕两天。帮助

换句话说,对于包含邀请的消息,在addHandler中放入什么?

更新

我必须放

Chat.connection.addHandler(Chat.on_message,null, "message"); 

在我邀请之前。

我不明白为什么?有人知道吗?

您开始使用的2个处理程序需要一个类型。邀请没有类型。我用于邀请的处理程序会查找命名空间。这样它就与我的消息处理程序分离了。

connection.addHandler(onInvite,'jabber:x:conference');