diff options
| author | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2017-10-13 09:17:22 +0300 | 
|---|---|---|
| committer | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2017-10-13 09:17:22 +0300 | 
| commit | 152e0d77c1a15f9279a92923666ab92c6fc88163 (patch) | |
| tree | 11465434e6de3e4d32c4309fd0895863e88e363c | |
| parent | Fix ZH translation (diff) | |
Send presence-unavailable when expulsing a participant
| -rw-r--r-- | src/mod_muc_room.erl | 12 | 
1 files changed, 10 insertions, 2 deletions
| diff --git a/src/mod_muc_room.erl b/src/mod_muc_room.erl index e06c20683..27ecceecf 100644 --- a/src/mod_muc_room.erl +++ b/src/mod_muc_room.erl @@ -1260,8 +1260,16 @@ expulse_participant(Packet, From, StateData, Reason1) ->      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) +	{ok, [_, _ | _]} -> +	    Aff = get_affiliation(From, StateData), +	    Item = #muc_item{affiliation = Aff, role = none, jid = From}, +	    Pres = xmpp:set_subtag( +		     Packet, #muc_user{items = [Item], +				       status_codes = [110]}), +	    send_wrapped(jid:replace_resource(StateData#state.jid, Nick), +			 From, Pres, ?NS_MUCSUB_NODES_PRESENCE, StateData); +	_ -> +	    send_new_presence(From, NewState, StateData)      end,      remove_online_user(From, NewState). | 
