Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/89.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript strophe muc衰退组邀请节_Javascript_Jquery_Xmpp_Strophe - Fatal编程技术网

Javascript strophe muc衰退组邀请节

Javascript strophe muc衰退组邀请节,javascript,jquery,xmpp,strophe,Javascript,Jquery,Xmpp,Strophe,嗨,我在拒绝邀请聊天室时遇到问题。这是我的诗节: var msg = $msg({"from" : tojid,"to" : room}).c("x", {"xmlns" : Strophe.NS.MUC_USER}).c("decline", {"to" : fromjid+"@188.2.16.19"}); msg.c("reason").t("Can talk right now."); Chat.connection.send(msg.tree()); 但这不是第一次发送,邀请也不会

嗨,我在拒绝邀请聊天室时遇到问题。这是我的诗节:

var msg = $msg({"from" : tojid,"to" : room}).c("x", {"xmlns" : Strophe.NS.MUC_USER}).c("decline", {"to" : fromjid+"@188.2.16.19"});

msg.c("reason").t("Can talk right now.");
Chat.connection.send(msg.tree());
但这不是第一次发送,邀请也不会被拒绝。它一直在回来。 如果我在发送方端发送两次,我会得到响应:

<body xmlns='http://jabber.org/protocol/httpbind'><message xmlns="jabber:client" from="epthi_702@conference.188.2.16.19" to="nikola_degree361_com@188.2.16.19"><x xmlns="http://jabber.org/protocol/muc#user"><decline from="nikola_pregmatch_org@188.2.16.19"><reason>Can talk right now.</reason></decline></x></message></body>
我添加了一个“Action”属性,并使用相同的名称空间返回它。我的“onInvite”处理程序查找“action==='deny”,并相应地处理它

连接().send($msg)({ 致:toJid, from:fromJid}.c('x'{ xmlns:“jabber:x:会议”, jid:roomJid,
操作:'deny'}).tree();

谢谢,我会试试这个。我会通知你的。我和以前一样有问题,我无法摆脱那个邀请消息。我已经发送了你的这一节,但这不起作用。有什么想法吗?好的,我误读了你的内容。你需要一个名称空间为“”(或者MUC用户,如果你有MUC插件)。然后,您可以获取“拒绝”元素并从中进行评估。添加该元素后,查看是否可以消除多条消息。
Chat.connection.addHandler(Chat.onInvite,"jabber:x:conference");