ChatGui.GuiSendsMsg C# (CSharp) Method

GuiSendsMsg() private method

private GuiSendsMsg ( ) : void
return void
    private void GuiSendsMsg()
    {
        if (string.IsNullOrEmpty(this.inputLine))
        {

            GUI.FocusControl("");
            return;
        }

        if (this.inputLine[0].Equals('/'))
        {
            string[] tokens = this.inputLine.Split(new char[] {' '}, 2);
            if (tokens[0].Equals("/help"))
            {
                this.PostHelpToCurrentChannel();
            }
            if (tokens[0].Equals("/join") && !string.IsNullOrEmpty(tokens[1]))
            {
                this.chatClient.Subscribe(tokens[1].Split(new char[] {' ', ','}));
            }
            else if (tokens[0].Equals("/leave") && !string.IsNullOrEmpty(tokens[1]))
            {
                this.chatClient.Unsubscribe(tokens[1].Split(new char[] {' ', ','}));
            }
            else if (tokens[0].Equals("/clear"))
            {
                if (this.doingPrivateChat)
                {
                    this.chatClient.PrivateChannels.Remove(this.selectedChannelName);
                }
                else
                {
                    ChatChannel channel;
                    if (this.chatClient.TryGetChannel(this.selectedChannelName, this.doingPrivateChat, out channel))
                    {
                        channel.ClearMessages();
                    }
                }
            }
            else if (tokens[0].Equals("/w") && !string.IsNullOrEmpty(tokens[1]))
            {
                string[] subtokens = tokens[1].Split(new char[] {' ', ','}, 2);
                string targetUser = subtokens[0];
                string message = subtokens[1];
                this.chatClient.SendPrivateMessage(targetUser, message);
            }
        }
        else
        {
            if (this.doingPrivateChat)
            {
                this.chatClient.SendPrivateMessage(this.userIdInput, this.inputLine);
            }
            else
            {
                this.chatClient.PublishMessage(this.selectedChannelName, this.inputLine);
            }
        }

        this.inputLine = "";
        GUI.FocusControl("");
    }