MsgCommunicator: Delphi Instant Messaging (IM) SDK
for easy creation of custom messenger system


TMsgClient.AddUserToContacts
TMsgClient
Top 

Adds new user to contacts list of this client.

function AddUserToContacts(UserID: Cardinal; ContactNameSource: TMsgContactNameSource = mcnsUserName; ContactCustomName: ShortString = ''): Integer;

Description
Call AddUserToContacts to add new user to contact list of this client. AddUserToContacts sends command to the server, waits for an answer, then updates local contacts list of this client and returns MSG_COMMAND_OK if this operation executed successfully, otherwise it returns one of the following error codes:

Name
Value
MSG_Error_AddUserToContacts_NotConnected   
MSG_Error_AddUserToContacts_SendCommandFailed   
MSG_Error_AddUserToContacts_ReceiveResultFailed   
MSG_Error_AddUserToContacts_InvalidParams   
MSG_Error_AddUserToContacts_InvalidServerReply   
MSG_Error_AddUserToContacts_Failed   
MSG_Error_AddUserToContacts_UserDoesNotExist
MSG_Error_AddUserToContacts_NotLogged
60040   
60041   
60042   
60043   
60044   
60045   
60046
60107


You can specify ContactNameSource to set a format for a visible name or even set custom name by specifying ContactCustomName and setting ContactNameSource to mcnsCustom. Read about TMsgContactNameSource type to learn details.

Here you can see the full list of the Return Codes and Error Codes of Client Methods.



© AidAim Software MsgCommunicator: