mirror of
https://github.com/processone/ejabberd
synced 2025-10-04 02:09:33 +02:00
Don't use jid:from_string as it's deprecated, see jid.erl line 43
This commit is contained in:
parent
64333f69ea
commit
d7a999eaf5
1 changed files with 6 additions and 3 deletions
|
@ -3746,13 +3746,16 @@ process_iq_mucsub(From, #iq{type = set, lang = Lang,
|
||||||
StateData) when UnsubJid /= <<>> ->
|
StateData) when UnsubJid /= <<>> ->
|
||||||
FAffiliation = get_affiliation(From, StateData),
|
FAffiliation = get_affiliation(From, StateData),
|
||||||
FRole = get_role(From, StateData),
|
FRole = get_role(From, StateData),
|
||||||
if FRole == moderator; FAffiliation == owner; FAffiliation == admin ->
|
try jid:decode(UnsubJid) of
|
||||||
FromUnsub = jid:from_string(UnsubJid),
|
FromUnsub when FRole == moderator; FAffiliation == owner; FAffiliation == admin ->
|
||||||
process_iq_mucsub(FromUnsub, #iq{type = set, sub_els = [#muc_unsubscribe{jid = <<>>}]},
|
process_iq_mucsub(FromUnsub, #iq{type = set, sub_els = [#muc_unsubscribe{jid = <<>>}]},
|
||||||
StateData);
|
StateData);
|
||||||
true ->
|
_ ->
|
||||||
Txt = <<"Moderator privileges required">>,
|
Txt = <<"Moderator privileges required">>,
|
||||||
{error, xmpp:err_forbidden(Txt, Lang)}
|
{error, xmpp:err_forbidden(Txt, Lang)}
|
||||||
|
catch
|
||||||
|
error:{bad_jid,_} ->
|
||||||
|
{error, xmpp:err_jid_malformed()}
|
||||||
end;
|
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) ->
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue