ChatBox - Messages
Messages are much more simple than channels, since there is a lot less going on.
When you first join the very first thing that you do as a client is request the server for all the chat history for your joined channels by making a GetMessageHistory and pass it a list of channelId's that you want the message history for. The server will immediatly respond back and based on the list that is received from the server will instantiate messages in the chat window for the target channel.
Get Message History For Channel(s)
It's easy to get the entire message history (up to server kept amount) for a channel by simply calling the GetMessageHistory function with a list of channels you want to get the message history for.
Example - Get Message History For Channel(s)
List<int> channelIds = new List<string>();
foreach(ChannelInfo item in ChatBox.instance.joinedChannels)
{
channelIds.Add(item.id);
}
ChatBox.instance.GetMessageHistory(channelIds);
Send A Message
This will get whatever text is currently in your messageInput, aka InputField, and send it to the server via the SendMessage function. If you want to do some sort of profanity filtering it would be best achieved in the ClientChatMessage function that gets called on the server with the clients chat message. You can then filter the message or just straight not send it if it contains your regex/filter pattern.
Example - Send A Message
ChatBox.instance.SendMessage();
Receive A Message
When another client has sent a message to a channel via the server, the server will respond to you and trigger the ReceiveChatMessage function. By default it will instantiate the message into the chat window. If you want to do additional things, like so a "New Message" icon. This would be the place to do it.