25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-24 16:23:40 +01:00

Simplify result of get_room_affiliation command (#2301)

This commit is contained in:
Badlop 2018-03-01 19:45:16 +01:00
parent 3003307e60
commit ad0fd1eac1

View File

@ -320,9 +320,9 @@ get_commands_spec() ->
args_desc = ["Room name", "MUC service", "User JID"],
args_example = ["room1", "muc.example.com", "user1@example.com"],
result_desc = "Affiliation of the user",
result_example = {member},
result_example = member,
args = [{name, binary}, {service, binary}, {jid, binary}],
result = {affiliation, {tuple, [{affiliation, atom}]}}}
result = {affiliation, atom}}
].
@ -1057,8 +1057,7 @@ get_room_affiliation(Name, Service, JID) ->
%% Get the PID of the online room, then request its state
{ok, StateData} = p1_fsm:sync_send_all_state_event(Pid, get_state),
UserJID = jid:decode(JID),
Affiliation = mod_muc_room:get_affiliation(UserJID, StateData),
{Affiliation};
mod_muc_room:get_affiliation(UserJID, StateData);
error ->
throw({error, "The room does not exist."})
end.