mirror of
https://github.com/processone/ejabberd
synced 2025-10-03 09:49:18 +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 /= <<>> ->
|
||||
FAffiliation = get_affiliation(From, StateData),
|
||||
FRole = get_role(From, StateData),
|
||||
if FRole == moderator; FAffiliation == owner; FAffiliation == admin ->
|
||||
FromUnsub = jid:from_string(UnsubJid),
|
||||
try jid:decode(UnsubJid) of
|
||||
FromUnsub when FRole == moderator; FAffiliation == owner; FAffiliation == admin ->
|
||||
process_iq_mucsub(FromUnsub, #iq{type = set, sub_els = [#muc_unsubscribe{jid = <<>>}]},
|
||||
StateData);
|
||||
true ->
|
||||
_ ->
|
||||
Txt = <<"Moderator privileges required">>,
|
||||
{error, xmpp:err_forbidden(Txt, Lang)}
|
||||
catch
|
||||
error:{bad_jid,_} ->
|
||||
{error, xmpp:err_jid_malformed()}
|
||||
end;
|
||||
process_iq_mucsub(From, #iq{type = set, sub_els = [#muc_unsubscribe{}]},
|
||||
StateData) ->
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue