Move a user from one group of the common contact list to another group.

 

Syntax

function mMoveUserToDepartment(iUIN, iGroupID: integer): integer;

 

Parameters and return values

Parameter

Type

Value

iUIN

integer

user ID;

iGroupID

integer

group ID in a common contact group.

 

Function result

0

function executed successfully; a user moved from old group of the common contact list to the new one;

-1

you can't work with built-in bot (UIN=0)

-2

common contact list is empty;

-3

user with such UIN is not registered on the server;

-4

user with such UIN does not exist in the common contact list;

-5

group with such ID does not exist in the common contact list.

 

Example


var
  iUIN, iNewDeptID: integer;
begin
  iUIN := 3;
  
  iNewDeptID := mGetDepartmentIDByTextPath('TestDivision');
    
    if iNewDeptID > 0 then begin
      mMoveUserToDepartment(iUIN, iNewDeptID);
      mCommonContactsRebuild;
    end;  
end.


Script work result

Move a user to another department in MyChat Client

 

See also

mCommonContactsRebuild

mGetDepartmentIDByTextPath