Fix unsubscribe command result, handle_sync_event result, and dialyzer
How to reproduce the problems fixed by this commit: Create temporary room, other account subscribes, and owner leaves Unsubscribe that account with the command: ejabberdctl unsubscribe_room ...
This commit is contained in:
parent
e6065bf08f
commit
150b7e7219
|
@ -217,6 +217,8 @@ unsubscribe(Pid, JID) ->
|
||||||
try p1_fsm:sync_send_all_state_event(Pid, {muc_unsubscribe, JID})
|
try p1_fsm:sync_send_all_state_event(Pid, {muc_unsubscribe, JID})
|
||||||
catch _:{timeout, {p1_fsm, _, _}} ->
|
catch _:{timeout, {p1_fsm, _, _}} ->
|
||||||
{error, ?T("Request has timed out")};
|
{error, ?T("Request has timed out")};
|
||||||
|
exit:{normal, {p1_fsm, _, _}} ->
|
||||||
|
ok;
|
||||||
_:{_, {p1_fsm, _, _}} ->
|
_:{_, {p1_fsm, _, _}} ->
|
||||||
{error, ?T("Conference room does not exist")}
|
{error, ?T("Conference room does not exist")}
|
||||||
end.
|
end.
|
||||||
|
@ -747,7 +749,7 @@ handle_sync_event({muc_unsubscribe, From}, _From, StateName,
|
||||||
from = From, sub_els = [#muc_unsubscribe{}]},
|
from = From, sub_els = [#muc_unsubscribe{}]},
|
||||||
case process_iq_mucsub(From, IQ, StateData) of
|
case process_iq_mucsub(From, IQ, StateData) of
|
||||||
{result, _, stop} ->
|
{result, _, stop} ->
|
||||||
{stop, ok, normal, StateData#state{config = Conf#config{persistent = false}}};
|
{stop, normal, StateData#state{config = Conf#config{persistent = false}}};
|
||||||
{result, _, NewState} ->
|
{result, _, NewState} ->
|
||||||
{reply, ok, StateName, NewState};
|
{reply, ok, StateName, NewState};
|
||||||
{ignore, NewState} ->
|
{ignore, NewState} ->
|
||||||
|
@ -4201,7 +4203,7 @@ process_iq_vcard(From, #iq{type = set, lang = Lang, sub_els = [Pkt]},
|
||||||
|
|
||||||
-spec process_iq_mucsub(jid(), iq(), state()) ->
|
-spec process_iq_mucsub(jid(), iq(), state()) ->
|
||||||
{error, stanza_error()} |
|
{error, stanza_error()} |
|
||||||
{result, undefined | muc_subscribe() | muc_subscriptions(), state()} |
|
{result, undefined | muc_subscribe() | muc_subscriptions(), stop | state()} |
|
||||||
{ignore, state()}.
|
{ignore, state()}.
|
||||||
process_iq_mucsub(_From, #iq{type = set, lang = Lang,
|
process_iq_mucsub(_From, #iq{type = set, lang = Lang,
|
||||||
sub_els = [#muc_subscribe{}]},
|
sub_els = [#muc_subscribe{}]},
|
||||||
|
|
Loading…
Reference in New Issue