diff --git a/PolyChat/Controller.cs b/PolyChat/Controller.cs index ea71b49..697d500 100644 --- a/PolyChat/Controller.cs +++ b/PolyChat/Controller.cs @@ -28,8 +28,6 @@ namespace PolyChat private readonly FileManager fileManager; // Props private Dictionary Connections = new Dictionary(); - private string OwnName = ""; - private string OwnIP; /// /// Initializes Controller with UI access @@ -39,7 +37,7 @@ namespace PolyChat { UIController = uiController; fileManager = new FileManager(this); - OwnIP = getIP(); + //OwnIP = getIP(); fileManager.loadChats(); Serve(); diff --git a/PolyChat/MainPage.xaml.cs b/PolyChat/MainPage.xaml.cs index 59ef3c3..452e752 100644 --- a/PolyChat/MainPage.xaml.cs +++ b/PolyChat/MainPage.xaml.cs @@ -99,7 +99,9 @@ namespace PolyChat { string ip = IP.GetIPFromCode(dialog.getValue()); Controller.Connect(ip); - Partners.Add(new ChatPartner( + ChatPartner pa = Partners.FirstOrDefault(p => p.Code == ip); + if (pa == null) + Partners.Add(new ChatPartner( "Connecting...", ip ));