gpt4 book ai didi

xmpp - 获取MUC Room的成员(member)昵称

转载 作者:行者123 更新时间:2023-12-01 05:20:02 28 4
gpt4 key购买 nike

有没有办法通过 ejabberd 服务器获取 MUC Room 的所有昵称?

我正在尝试:

<iq from='crone1@shakespeare.lit/desktop'
id='member3'
to='coven@chat.shakespeare.lit'
type='get'>
<query xmlns='http://jabber.org/protocol/muc#admin'>
<item affiliation='member'/>
</query>
</iq>

但我只获得没有昵称的 jid:
<iq from='coven@chat.shakespeare.lit'
id='member3'
to='crone1@shakespeare.lit/desktop'
type='result'>
<query xmlns='http://jabber.org/protocol/muc#admin'>
<item affiliation='member'
jid='hag66@shakespeare.lit'
role='participant'/>
</query>
</iq>

最佳答案

6.5 Querying for Room Items来自 XEP 0045当你寄出

<iq from='$user-name@$user-server/$user-resorce'
id='someid'
to='$chat-room-to-query@$chatserver'
type='get'>
<query xmlns='http://jabber.org/protocol/disco#items'/>
</iq>

您有以下描述

An implementation MAY return a list of existing occupants if that information is publicly available, or return no list at all if this information is kept private.(emphasis mine)



如果房间是公开的,你会得到
<iq from='$chat-room-to-query@$chatserver'
id='someid'
to='$user-name@$user-server/$user-resorce'
type='result'>
<query xmlns='http://jabber.org/protocol/disco#items'>
<item jid='$chat-room-to-query@$chatserver/$firstnick'/>
<item jid='$chat-room-to-query@$chatserver/$secondnick'/>
<...>
</query>
</iq>

据我所知,ejabberd 正确地实现了这一点。

关于xmpp - 获取MUC Room的成员(member)昵称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17145899/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com