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


TMsgClient.SendMessage
TMsgClient
Top 

Sends a custom message.

function SendMessage(ToUserID: Cardinal; const Text: String; Directly: Boolean = True): Integer;
function SendMessage(ToUserID: Cardinal; Buffer: PChar; Size: Integer; Directly: Boolean = True): Integer;
function SendMessage(ToUserID: Cardinal; Stream: TStream; Directly: Boolean = True): Integer;

Description

Call SendMessage to send a custom message to the recipient (user or server).
ToUserID is an identifier of the recipient, i.e. UserID or ServerID.
Text is a text of the message.
Buffer is a binary buffer (can be nil).
Size is a size of the binary buffer (must be >= 0).
Stream is a stream with message data.
Set Directly to False to force the client to send message through the server only. Otherwise, it will try to send message to other client directly.

To receive messages, set one of the following event handlers:
OnReceiveTextMessage
OnReceiveBinaryMessage
OnReceiveStreamMessage

SendMessage can return one of the following error codes:
Name
Value
MSG_Error_SendMessage_CannotFindSession
MSG_Error_SendMessage_SendFailed
MSG_Error_SendMessage_SaveHistoryToDatabaseFailed
MSG_Error_SendMessage_NotLogged
MSG_Error_SendMessage_ToGuest
MSG_Error_SendMessage_SessionNotFound
60081
60082
60083
60119
60120
60121




© AidAim Software MsgCommunicator: