public void SendMessage(IChatUi chatClient, string recipient, string messageText) { try { var message = new Message(chatClient.Username, recipient, messageText); Configuration.AppendToFile(recipient, message.ToString()); chatClient.AddChatLine(message); } catch (ArgumentException ae) { chatClient.AddChatErrorLine($"Message could not be sent :: {ae.Message}"); } }
public void AddChatErrorLine(string username, string errorMessage) { IChatUi chatClient = getChatClient(username); chatClient.AddChatErrorLine(errorMessage); }