diff options
author | Paweł Chmielowski <pchmielowski@process-one.net> | 2020-03-23 13:16:48 +0100 |
---|---|---|
committer | Paweł Chmielowski <pchmielowski@process-one.net> | 2020-03-23 13:16:48 +0100 |
commit | 97354426cfb142510ba42bc76894c3a998a35419 (patch) | |
tree | 4e2bc5efe7d1196bc89e85365d0440d4c5496008 /src/mod_muc_room.erl | |
parent | Better handling of xml parse errors in send_stanza (diff) |
Make mod_muc_room:unsubscirbe handle that unsubscribe may stop room
Diffstat (limited to 'src/mod_muc_room.erl')
-rw-r--r-- | src/mod_muc_room.erl | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mod_muc_room.erl b/src/mod_muc_room.erl index 4d8816e9..0ff547cf 100644 --- a/src/mod_muc_room.erl +++ b/src/mod_muc_room.erl @@ -741,10 +741,13 @@ handle_sync_event({muc_subscribe, From, Nick, Nodes}, _From, {error, Err} -> {reply, {error, get_error_text(Err)}, StateName, StateData} end; -handle_sync_event({muc_unsubscribe, From}, _From, StateName, StateData) -> +handle_sync_event({muc_unsubscribe, From}, _From, StateName, + #state{config = Conf} = StateData) -> IQ = #iq{type = set, id = p1_rand:get_string(), 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}}}; {result, _, NewState} -> {reply, ok, StateName, NewState}; {ignore, NewState} -> |