mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-20 17:27:00 +01:00
Simple optimization in get_room_occupants_number command (#1964)
This commit is contained in:
parent
4ecd8a0780
commit
d87151aee6
@ -802,7 +802,13 @@ get_room_occupants(Pid) ->
|
||||
dict:to_list(S#state.users)).
|
||||
|
||||
get_room_occupants_number(Room, Host) ->
|
||||
length(get_room_occupants(Room, Host)).
|
||||
case get_room_pid(Room, Host) of
|
||||
room_not_found ->
|
||||
throw({error, room_not_found});
|
||||
Pid ->
|
||||
S = get_room_state(Pid),
|
||||
dict:size(S#state.users)
|
||||
end.
|
||||
|
||||
%%----------------------------
|
||||
%% Send Direct Invitation
|
||||
|
Loading…
Reference in New Issue
Block a user