diff --git a/ErgometerDoctorApplication/Client/ClientThread.cs b/ErgometerDoctorApplication/Client/ClientThread.cs index 19025af..92aae43 100644 --- a/ErgometerDoctorApplication/Client/ClientThread.cs +++ b/ErgometerDoctorApplication/Client/ClientThread.cs @@ -50,7 +50,7 @@ namespace ErgometerDoctorApplication window.Invoke(window.updateMetingen, new Object[] { command.Meting }); break; case NetCommand.CommandType.CHAT: - ChatMessage chat = new ChatMessage(command.DisplayName, command.ChatMessage, false); + ChatMessage chat = new ChatMessage(command.DisplayName, command.ChatMessage, command.IsDoctor); Chat.Add(chat); window.panelClientChat.Invoke(window.panelClientChat.passChatMessage, new Object[] { chat }); break; diff --git a/ErgometerDoctorApplication/Client/PanelClientChat.cs b/ErgometerDoctorApplication/Client/PanelClientChat.cs index ec0f685..3cf4c66 100644 --- a/ErgometerDoctorApplication/Client/PanelClientChat.cs +++ b/ErgometerDoctorApplication/Client/PanelClientChat.cs @@ -17,8 +17,8 @@ namespace ErgometerDoctorApplication private System.Windows.Forms.Panel panel2; private System.Windows.Forms.Label label1; private System.Windows.Forms.Panel panel1; - private System.Windows.Forms.Button button1; - private System.Windows.Forms.RichTextBox richTextBox1; + public System.Windows.Forms.Button button1; + public System.Windows.Forms.RichTextBox richTextBox1; private System.Windows.Forms.Label label2; private System.Windows.Forms.Panel panel3; private System.Windows.Forms.Label connectionLabel; @@ -153,7 +153,7 @@ namespace ErgometerDoctorApplication if (richTextBox1.TextLength > 1) { AddChatItem(new ChatMessage("Doctor", richTextBox1.Text, true)); - MainClient.SendNetCommand(new NetCommand(richTextBox1.Text, Session)); + MainClient.SendNetCommand(new NetCommand(richTextBox1.Text, true, Session)); richTextBox1.ResetText(); } } diff --git a/ErgometerDoctorApplication/Client/SessionWindow.cs b/ErgometerDoctorApplication/Client/SessionWindow.cs index 1b9f811..aa469fc 100644 --- a/ErgometerDoctorApplication/Client/SessionWindow.cs +++ b/ErgometerDoctorApplication/Client/SessionWindow.cs @@ -42,8 +42,11 @@ namespace ErgometerDoctorApplication InitializeComponent(); - if (!ActiveSession) - panelClientChat.Visible = false; + if(! ActiveSession) + { + panelClientChat.richTextBox1.Enabled = false; + panelClientChat.button1.Enabled = false; + } } public void ClientApplicatie_Resize(object sender, EventArgs e) diff --git a/ErgometerDoctorApplication/MainClient.cs b/ErgometerDoctorApplication/MainClient.cs index 63c2363..de5947c 100644 --- a/ErgometerDoctorApplication/MainClient.cs +++ b/ErgometerDoctorApplication/MainClient.cs @@ -96,7 +96,7 @@ namespace ErgometerDoctorApplication loggedin = true; } - SendNetCommand(new NetCommand(NetCommand.RequestType.USERS, Session)); + //SendNetCommand(new NetCommand(NetCommand.RequestType.USERS, Session)); SendNetCommand(new NetCommand(NetCommand.RequestType.SESSIONDATA, Session)); return true; @@ -254,6 +254,7 @@ namespace ErgometerDoctorApplication return; SendNetCommand(new NetCommand(NetCommand.RequestType.OLDDATA, session)); + SendNetCommand(new NetCommand(NetCommand.RequestType.CHAT, session)); //Start new client ClientThread cl = new ClientThread(name, session, true);