"For developers", "Server scripts", "Functions description", "Users", "mGetUsersListByState".

 

Function to obtain a list of users by their status ("online", "offline", "do not disturb", "away").

 

Syntax

function mGetUsersListByState(iState: integer): string;

 

Parameters and return vslues

Parameter

Type

Value

iState

integer

users network status. If you specify "-2", the you get all the registered users.

 

Function result

Text string, the list of user UINs separated by commas. If there are no users, the function returns an empty string.

 

Example

const
  STATE_OFFLINE = -1;
  STATE_ONLINE  = 0;
  STATE_AWAY    = 1;
  STATE_DND     = 2;
begin
  mLogScript(mGetUsersListByState(STATE_OFFLINE), 'offline');
  mLogScript(mGetUsersListByState(STATE_ONLINE), 'online');
  mLogScript(mGetUsersListByState(STATE_AWAY), 'away');
  mLogScript(mGetUsersListByState(STATE_DND), 'do not disturb');
end.

Script work result

[08:00:42] (Log "mGetUsersListByState"): [offline] 10129,10161,10335,10336

[08:00:42] (Log "mGetUsersListByState"): [online] 17,19,1345

[08:00:42] (Log "mGetUsersListByState"): [away] 6547,7554

[08:00:42] (Log "mGetUsersListByState"): [do not disturb] 4578,6589

[08:00:42] (Run "mGetUsersListByState"): Script operation time: 8 ms

[08:00:42] (Run "mGetUsersListByState"): Script done successfully.

 

See also

mGetUsersListByParams

mLogScript