25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-24 17:29:28 +01:00

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:
Badlop 2020-03-24 11:44:22 +01:00
parent e6065bf08f
commit 150b7e7219

View File

@ -217,6 +217,8 @@ unsubscribe(Pid, JID) ->
try p1_fsm:sync_send_all_state_event(Pid, {muc_unsubscribe, JID})
catch _:{timeout, {p1_fsm, _, _}} ->
{error, ?T("Request has timed out")};
exit:{normal, {p1_fsm, _, _}} ->
ok;
_:{_, {p1_fsm, _, _}} ->
{error, ?T("Conference room does not exist")}
end.
@ -747,7 +749,7 @@ handle_sync_event({muc_unsubscribe, From}, _From, StateName,
from = From, sub_els = [#muc_unsubscribe{}]},
case process_iq_mucsub(From, IQ, StateData) of
{result, _, stop} ->
{stop, ok, normal, StateData#state{config = Conf#config{persistent = false}}};
{stop, normal, StateData#state{config = Conf#config{persistent = false}}};
{result, _, NewState} ->
{reply, ok, StateName, 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()) ->
{error, stanza_error()} |
{result, undefined | muc_subscribe() | muc_subscriptions(), state()} |
{result, undefined | muc_subscribe() | muc_subscriptions(), stop | state()} |
{ignore, state()}.
process_iq_mucsub(_From, #iq{type = set, lang = Lang,
sub_els = [#muc_subscribe{}]},