mirror of
https://github.com/processone/ejabberd.git
synced 2024-06-02 21:17:12 +02:00
Allow a room admin to unsubscribe another JID
This commit is contained in:
parent
0c0d79fd93
commit
177d5fec86
|
@ -3741,6 +3741,19 @@ process_iq_mucsub(From,
|
||||||
SD2 = StateData#state{config = (StateData#state.config)#config{allow_subscription = true}},
|
SD2 = StateData#state{config = (StateData#state.config)#config{allow_subscription = true}},
|
||||||
add_new_user(From, Nick, Packet, SD2)
|
add_new_user(From, Nick, Packet, SD2)
|
||||||
end;
|
end;
|
||||||
|
process_iq_mucsub(From, #iq{type = set, lang = Lang,
|
||||||
|
sub_els = [#muc_unsubscribe{jid = UnsubJid}]},
|
||||||
|
StateData) when UnsubJid /= <<>> ->
|
||||||
|
FAffiliation = get_affiliation(From, StateData),
|
||||||
|
FRole = get_role(From, StateData),
|
||||||
|
if FRole == moderator; FAffiliation == owner; FAffiliation == admin ->
|
||||||
|
FromUnsub = jid:from_string(UnsubJid),
|
||||||
|
process_iq_mucsub(FromUnsub, #iq{type = set, sub_els = [#muc_unsubscribe{jid = <<>>}]},
|
||||||
|
StateData);
|
||||||
|
true ->
|
||||||
|
Txt = <<"Moderator privileges required">>,
|
||||||
|
{error, xmpp:err_forbidden(Txt, Lang)}
|
||||||
|
end;
|
||||||
process_iq_mucsub(From, #iq{type = set, sub_els = [#muc_unsubscribe{}]},
|
process_iq_mucsub(From, #iq{type = set, sub_els = [#muc_unsubscribe{}]},
|
||||||
StateData) ->
|
StateData) ->
|
||||||
LBareJID = jid:tolower(jid:remove_resource(From)),
|
LBareJID = jid:tolower(jid:remove_resource(From)),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user