如何格式化XMPP状态节以加入MUC会议室 [英] How to format xmpp presence stanza to join a MUC room
问题描述
我试图弄清楚如何格式化发送到房间的状态节,并且我没有遵循我在网上找到的示例。
presence_stanza = f
特别是我不确定 /之后的ID /字符串是什么
来自地址。
供参考:
https://www.ejabberd.im/node/ 5189 / index.html
阅读多用户聊天规范,尤其是描述如何进入房间的部分: https ://xmpp.org/extensions/xep-0045.html#enter
规范示例得到了很好的注释。
您甚至不需要设置from。服务器将为您将其设置为当前会话的完整JID。
到
必须是完整的JID,包括确实的room_id,以及房间中用户的昵称。它应该是这样的:
< presence to='{room_id}@conference.domain.com/{user_nick_in_the_room}' />
I'm trying to figure out how to format a presence stanza being sent to a room, and I'm not following the examples I've found online.
presence_stanza = f"<presence xmlns='jabber:client' from='{user_id}@conference.domain.com/{what_goes_here} to='{room_id}@conference.domain.com'/>"
In particular I'm unsure what the ID/string that follows the /
in the from
address.
For reference:
https://www.ejabberd.im/node/5189/index.html
Ejabberd not sending presence stanza to other roster members
You should read the Multi-User chat specification, especially the part that describes how to enter the room: https://xmpp.org/extensions/xep-0045.html#enter
The spec example is well commented.
You do not even need to set the from. The server will set it for you to your current session full JID.
The to
needs to be a full JID including indeed the room_id, but also the nickname of your user in the room. It should be something like:
<presence to='{room_id}@conference.domain.com/{user_nick_in_the_room}'/>
这篇关于如何格式化XMPP状态节以加入MUC会议室的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!