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 92939c8230
commit cd26ac11c3

View File

@@ -104,9 +104,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);
} }