mirror of
https://github.com/processone/ejabberd.git
synced 2024-06-02 21:17:12 +02:00
* src/mod_muc/mod_muc_room.erl: Added support for grant/revoke
administrative/owner priveledges, fixed work with affiliations SVN Revision: 96
This commit is contained in:
parent
1c189c0f1b
commit
76fdfe18b4
|
@ -1,3 +1,8 @@
|
||||||
|
2003-03-28 Alexey Shchepin <alexey@sevcom.net>
|
||||||
|
|
||||||
|
* src/mod_muc/mod_muc_room.erl: Added support for grant/revoke
|
||||||
|
administrative/owner priveledges, fixed work with affiliations
|
||||||
|
|
||||||
2003-03-27 Alexey Shchepin <alexey@sevcom.net>
|
2003-03-27 Alexey Shchepin <alexey@sevcom.net>
|
||||||
|
|
||||||
* src/ejabberd.cfg: Updated
|
* src/ejabberd.cfg: Updated
|
||||||
|
|
|
@ -516,7 +516,7 @@ list_to_affiliation(Affiliation) ->
|
||||||
|
|
||||||
|
|
||||||
set_affiliation(JID, Affiliation, StateData) ->
|
set_affiliation(JID, Affiliation, StateData) ->
|
||||||
LJID = jlib:jid_tolower(JID),
|
LJID = jlib:jid_remove_resource(jlib:jid_tolower(JID)),
|
||||||
Affiliations = case Affiliation of
|
Affiliations = case Affiliation of
|
||||||
none ->
|
none ->
|
||||||
?DICT:erase(LJID,
|
?DICT:erase(LJID,
|
||||||
|
@ -533,7 +533,7 @@ get_affiliation(JID, StateData) ->
|
||||||
allow ->
|
allow ->
|
||||||
owner;
|
owner;
|
||||||
_ ->
|
_ ->
|
||||||
LJID = jlib:jid_tolower(JID),
|
LJID = jlib:jid_remove_resource(jlib:jid_tolower(JID)),
|
||||||
case ?DICT:find(LJID, StateData#state.affiliations) of
|
case ?DICT:find(LJID, StateData#state.affiliations) of
|
||||||
{ok, Affiliation} ->
|
{ok, Affiliation} ->
|
||||||
Affiliation;
|
Affiliation;
|
||||||
|
@ -1018,6 +1018,18 @@ process_admin_items_set(UJID, Items, StateData) ->
|
||||||
set_affiliation(
|
set_affiliation(
|
||||||
JID, outcast,
|
JID, outcast,
|
||||||
set_role(JID, none, SD));
|
set_role(JID, none, SD));
|
||||||
|
{JID, affiliation, A, Reason} when
|
||||||
|
(A == admin) or (A == owner)->
|
||||||
|
SD1 = set_affiliation(JID, A, SD),
|
||||||
|
SD2 = set_role(JID, moderator, SD1),
|
||||||
|
catch send_new_presence(JID, SD2),
|
||||||
|
SD2;
|
||||||
|
{JID, affiliation, member, Reason} ->
|
||||||
|
SD1 = set_affiliation(
|
||||||
|
JID, member, SD),
|
||||||
|
SD2 = set_role(JID, participant, SD1),
|
||||||
|
catch send_new_presence(JID, SD2),
|
||||||
|
SD2;
|
||||||
{JID, role, R, Reason} ->
|
{JID, role, R, Reason} ->
|
||||||
SD1 = set_role(JID, R, SD),
|
SD1 = set_role(JID, R, SD),
|
||||||
catch send_new_presence(JID, SD1),
|
catch send_new_presence(JID, SD1),
|
||||||
|
@ -1314,8 +1326,8 @@ process_iq_owner(From, set, SubEl, StateData) ->
|
||||||
end;
|
end;
|
||||||
[{xmlelement, "destroy", Attrs1, Els1}] ->
|
[{xmlelement, "destroy", Attrs1, Els1}] ->
|
||||||
destroy_room(Els1, StateData);
|
destroy_room(Els1, StateData);
|
||||||
_ ->
|
Items ->
|
||||||
{error, ?ERR_FEATURE_NOT_IMPLEMENTED}
|
process_admin_items_set(From, Items, StateData)
|
||||||
end;
|
end;
|
||||||
_ ->
|
_ ->
|
||||||
{error, ?ERR_FORBIDDEN}
|
{error, ?ERR_FORBIDDEN}
|
||||||
|
@ -1333,6 +1345,20 @@ process_iq_owner(From, get, SubEl, StateData) ->
|
||||||
case xml:remove_cdata(Els) of
|
case xml:remove_cdata(Els) of
|
||||||
[] ->
|
[] ->
|
||||||
get_config(Lang, StateData);
|
get_config(Lang, StateData);
|
||||||
|
[Item] ->
|
||||||
|
case xml:get_tag_attr("affiliation", Item) of
|
||||||
|
false ->
|
||||||
|
{error, ?ERR_BAD_REQUEST};
|
||||||
|
{value, StrAffiliation} ->
|
||||||
|
case catch list_to_affiliation(StrAffiliation) of
|
||||||
|
{'EXIT', _} ->
|
||||||
|
{error, ?ERR_BAD_REQUEST};
|
||||||
|
SAffiliation ->
|
||||||
|
Items = items_with_affiliation(
|
||||||
|
SAffiliation, StateData),
|
||||||
|
{result, Items, StateData}
|
||||||
|
end
|
||||||
|
end;
|
||||||
_ ->
|
_ ->
|
||||||
{error, ?ERR_FEATURE_NOT_IMPLEMENTED}
|
{error, ?ERR_FEATURE_NOT_IMPLEMENTED}
|
||||||
end;
|
end;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user