diff options
author | Matthew Wild <mwild1@gmail.com> | 2018-09-14 12:05:47 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2018-09-14 12:05:47 +0100 |
commit | 889612dd5a1625896943d4eb7c4f18c54ec43252 (patch) | |
tree | 76a31f8e259e7acfd0f703810ff80d8b567f3aac | |
parent | 03097e523057993058982974b0dfe9719281b924 (diff) | |
download | prosody-889612dd5a1625896943d4eb7c4f18c54ec43252.tar.gz prosody-889612dd5a1625896943d4eb7c4f18c54ec43252.zip |
MUC: Include 'nick' attribute in affiliation lists (thanks jc)
-rw-r--r-- | plugins/muc/muc.lib.lua | 3 | ||||
-rw-r--r-- | spec/scansion/muc_register.scs | 16 |
2 files changed, 18 insertions, 1 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua index 79fdd6e5..341a848d 100644 --- a/plugins/muc/muc.lib.lua +++ b/plugins/muc/muc.lib.lua @@ -965,7 +965,8 @@ function room_mt:handle_admin_query_get_command(origin, stanza) or self:get_members_only() and self:get_whois() == "anyone" and affiliation_rank >= valid_affiliations.member then local reply = st.reply(stanza):query("http://jabber.org/protocol/muc#admin"); for jid in self:each_affiliation(_aff or "none") do - reply:tag("item", {affiliation = _aff, jid = jid}):up(); + local nick = self:get_registered_nick(jid); + reply:tag("item", {affiliation = _aff, jid = jid, nick = nick }):up(); end origin.send(reply:up()); return true; diff --git a/spec/scansion/muc_register.scs b/spec/scansion/muc_register.scs index b76055b1..af0cdc07 100644 --- a/spec/scansion/muc_register.scs +++ b/spec/scansion/muc_register.scs @@ -365,3 +365,19 @@ Romeo receives: </query> </iq> +# To check the status of the room is as expected, Romeo requests the member list + +Romeo sends: + <iq id='member3' to='room@conference.localhost' type='get'> + <query xmlns='http://jabber.org/protocol/muc#admin'> + <item affiliation='member'/> + </query> + </iq> + +Romeo receives: + <iq from='room@conference.localhost' type='result' id='member3'> + <query xmlns='http://jabber.org/protocol/muc#admin'> + <item jid="${Juliet's JID}" affiliation='member' nick='Juliet'/> + </query> + </iq> + |