Delete a user from a specified user's personal contact list.

 

Syntax

function mPersonalContactsDeleteUser(iUINOwner, iUIN: integer): integer;

 

Parameters and return values

Parameter

Type

Value

iUINOwner

integer

user unique ID; an owner of a personal contact list, >0;

iUIN

integer

ID of a user you need to delete UIN > 0.

 

Function result

0

no errors, a user was deleted successfully;

-1

owner's personal contact list is empty;

-2

UIN you want to delete is not in the owner's personal contact list;

-3

UIN of the contact list owner is not registered on the server;

-4

UIN of the user you try to delete is not registered on the server;

-5

UIN can't be 0 (built-in bot).

 

Example


const
  UIN_OWNER  = 6;
  UIN_USER   = 3;
var
  sMsg: string;
  iResult: integer;
begin
  iResult := mPersonalContactsDeleteUser(UIN_OWNER, UIN_USER);
   
    case iResult of
       0: begin
         sMsg := 'all ok!';
         mPersonalContactsRefresh(UIN_OWNER);
       end;  
      -1: sMsg := 'iUINOwner doesn''t have any contacts';
      -2: sMsg := 'UIN is not in the list';
      -3: sMsg := 'iUINOwner doesn''t exist';
      -4: sMsg := 'iUIN doesn''t exist';
      -5: sMsg := 'you can''t use the robot''s UIN :-[';
     end;
        
  mLogScript(sMsg, '');  
end.


Script work result

[15:43:58] (Log "mPersonalContactsDeleteUser"): UIN is not in the list

[15:43:58] (Run "mPersonalContactsDeleteUser"): Script operation time: 8 ms

[15:43:58] (Run "mPersonalContactsDeleteUser"): Script done successfully.

 

See also

mPersonalContactsRefresh

mLogScript