allow deletion of chats which are not started by me

This commit is contained in:
Felix Hartmann (PEA3-Fe-FI)
2021-09-23 09:41:56 +02:00
parent e1ea49bf71
commit 1b3d133657

View File

@@ -101,9 +101,13 @@ namespace PolyChat
} }
public void CloseChat(string IP, bool wasConnected = true) public void CloseChat(string IP, bool wasConnected = true)
{
Debug.WriteLine($"Deleting connection with IP:{IP}");
if (IP != null && Connections.ContainsKey(IP))
{ {
Connections[IP].Close(); Connections[IP].Close();
Connections.Remove(IP); Connections.Remove(IP);
}
CloseChatUI(IP,wasConnected); CloseChatUI(IP,wasConnected);
} }