mirror of
https://github.com/processone/ejabberd.git
synced 2024-06-12 21:52:07 +02:00
Fixed support for multi-resource occupants (EJAB-305)
This commit is contained in:
parent
dbb2d1c229
commit
b8969f68e0
|
@ -2464,7 +2464,7 @@ process_admin_items_set(UJID, Items, Lang, StateData) ->
|
||||||
NSD ->
|
NSD ->
|
||||||
NSD
|
NSD
|
||||||
end
|
end
|
||||||
end, StateData, Res),
|
end, StateData, lists:flatten(Res)),
|
||||||
case (NSD#state.config)#config.persistent of
|
case (NSD#state.config)#config.persistent of
|
||||||
true ->
|
true ->
|
||||||
mod_muc:store_room(NSD#state.host, NSD#state.room,
|
mod_muc:store_room(NSD#state.host, NSD#state.room,
|
||||||
|
@ -2501,7 +2501,7 @@ find_changed_items(UJID, UAffiliation, URole,
|
||||||
_ ->
|
_ ->
|
||||||
case xml:get_attr("nick", Attrs) of
|
case xml:get_attr("nick", Attrs) of
|
||||||
{value, N} ->
|
{value, N} ->
|
||||||
case find_jid_by_nick(N, StateData) of
|
case find_jids_by_nick(N, StateData) of
|
||||||
false ->
|
false ->
|
||||||
ErrText =
|
ErrText =
|
||||||
io_lib:format(
|
io_lib:format(
|
||||||
|
@ -2518,7 +2518,7 @@ find_changed_items(UJID, UAffiliation, URole,
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
case TJID of
|
case TJID of
|
||||||
{value, JID} ->
|
{value, [JID|_]=JIDs} ->
|
||||||
TAffiliation = get_affiliation(JID, StateData),
|
TAffiliation = get_affiliation(JID, StateData),
|
||||||
TRole = get_role(JID, StateData),
|
TRole = get_role(JID, StateData),
|
||||||
case xml:get_attr("role", Attrs) of
|
case xml:get_attr("role", Attrs) of
|
||||||
|
@ -2568,16 +2568,13 @@ find_changed_items(UJID, UAffiliation, URole,
|
||||||
Items, Lang, StateData,
|
Items, Lang, StateData,
|
||||||
Res);
|
Res);
|
||||||
true ->
|
true ->
|
||||||
|
Reason = xml:get_path_s(Item, [{elem, "reason"}, cdata]),
|
||||||
|
MoreRes = [{jlib:jid_remove_resource(Jidx), affiliation, SAffiliation, Reason} || Jidx <- JIDs],
|
||||||
find_changed_items(
|
find_changed_items(
|
||||||
UJID,
|
UJID,
|
||||||
UAffiliation, URole,
|
UAffiliation, URole,
|
||||||
Items, Lang, StateData,
|
Items, Lang, StateData,
|
||||||
[{jlib:jid_remove_resource(JID),
|
[MoreRes | Res]);
|
||||||
affiliation,
|
|
||||||
SAffiliation,
|
|
||||||
xml:get_path_s(
|
|
||||||
Item, [{elem, "reason"},
|
|
||||||
cdata])} | Res]);
|
|
||||||
false ->
|
false ->
|
||||||
{error, ?ERR_NOT_ALLOWED}
|
{error, ?ERR_NOT_ALLOWED}
|
||||||
end
|
end
|
||||||
|
@ -2625,14 +2622,13 @@ find_changed_items(UJID, UAffiliation, URole,
|
||||||
Items, Lang, StateData,
|
Items, Lang, StateData,
|
||||||
Res);
|
Res);
|
||||||
true ->
|
true ->
|
||||||
|
Reason = xml:get_path_s(Item, [{elem, "reason"}, cdata]),
|
||||||
|
MoreRes = [{Jidx, role, SRole, Reason} || Jidx <- JIDs],
|
||||||
find_changed_items(
|
find_changed_items(
|
||||||
UJID,
|
UJID,
|
||||||
UAffiliation, URole,
|
UAffiliation, URole,
|
||||||
Items, Lang, StateData,
|
Items, Lang, StateData,
|
||||||
[{JID, role, SRole,
|
[MoreRes | Res]);
|
||||||
xml:get_path_s(
|
|
||||||
Item, [{elem, "reason"},
|
|
||||||
cdata])} | Res]);
|
|
||||||
_ ->
|
_ ->
|
||||||
{error, ?ERR_NOT_ALLOWED}
|
{error, ?ERR_NOT_ALLOWED}
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user