Send a text chat message to an online friend.
This function creates a chat message packet and pushes it into the send queue.
The message length may not exceed MAX_MESSAGE_LENGTH. Larger messages must be split by the client and sent as separate messages. Other clients can then reassemble the fragments. Messages may not be empty.
The return value of this function is the message ID. If a read receipt is received, the triggered `friend_read_receipt` event will be passed this message ID.
Message IDs are unique per friend. The first message ID is 0. Message IDs are incremented by 1 each time a message is sent. If UINT32_MAX messages were sent, the next message ID is 0.
friend_number |
The friend number of the friend to send the message to. |
type |
Message type (normal, action, ...). |
message |
A non-NULL pointer to the first element of a byte array containing the message text. |