diff options
| author | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2017-09-26 19:01:54 +0300 |
|---|---|---|
| committer | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2017-09-26 19:01:54 +0300 |
| commit | e1efd291568aae29ac06f507c8b0bbf60b65d91a (patch) | |
| tree | ef3913e073acbec968e59e03cced4826cf5da437 /src | |
| parent | Call earlier deps configure scripts durring compilation (diff) | |
Improve presence-error processing
When a presence-error is received from a participant in a MUC, kick
only this particular participant's full JID, leaving other resources
untouched. This will prevent from erroneous kicking all user's resources
in the presence of "multi-session nicks".
Diffstat (limited to 'src')
| -rw-r--r-- | src/mod_muc_room.erl | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mod_muc_room.erl b/src/mod_muc_room.erl index 41e776339..d883788dd 100644 --- a/src/mod_muc_room.erl +++ b/src/mod_muc_room.erl @@ -1243,7 +1243,12 @@ expulse_participant(Packet, From, StateData, Reason1) -> #presence{type = unavailable, status = xmpp:mk_text(Reason2)}, StateData), - send_new_presence(From, NewState, StateData), + LJID = jid:tolower(From), + {ok, #user{nick = Nick}} = (?DICT):find(LJID, StateData#state.users), + case (?DICT):find(Nick, StateData#state.nicks) of + {ok, [_, _ | _]} -> ok; + _ -> send_new_presence(From, NewState, StateData) + end, remove_online_user(From, NewState). -spec set_affiliation(jid(), affiliation(), state()) -> state(). |
