diff options
author | Badlop <badlop@process-one.net> | 2020-03-24 13:44:22 +0300 |
---|---|---|
committer | Badlop <badlop@process-one.net> | 2020-03-24 13:44:22 +0300 |
commit | 150b7e7219c315a25d7eae63eff9c8ee7ab81eb8 (patch) | |
tree | c5c98ddc8ffaa9c5de154d4e27455cfe12f5f7e8 | |
parent | e6065bf08faf4a0dd1d29f58d84c1938e7ac966b (diff) |
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 ...
-rw-r--r-- | src/mod_muc_room.erl | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mod_muc_room.erl b/src/mod_muc_room.erl index 0ff547cfe..03faa6a06 100644 --- a/src/mod_muc_room.erl +++ b/src/mod_muc_room.erl @@ -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{}]}, |