【发布时间】:2013-12-07 15:30:39
【问题描述】:
我的邀请处理程序有问题。它永远不会被解雇。我可以看到来自群组的邀请:
<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");
在我邀请之前。
我不明白为什么会这样?有人知道吗?
【问题讨论】:
标签: javascript php strophe libstrophe