From e27141e0136404d715972be65bd2f76930b2a6d2 Mon Sep 17 00:00:00 2001 From: SCM6WE Date: Thu, 23 Sep 2021 11:09:43 +0200 Subject: [PATCH] fix connection establishment when loading files --- PolyChat/Controller.cs | 3 +++ PolyChat/Models/ChatMessage.cs | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/PolyChat/Controller.cs b/PolyChat/Controller.cs index 8f5f6bc..4e98d70 100644 --- a/PolyChat/Controller.cs +++ b/PolyChat/Controller.cs @@ -166,6 +166,8 @@ namespace PolyChat /// public void loadChats() { + + //load dir and create if non existant if (Directory.Exists("U:\\PolyChat\\Saves")) { @@ -190,6 +192,7 @@ namespace PolyChat ip = ip.Substring(0, ip.Length - 4); Debug.WriteLine("-" + ip + "-"); Debug.WriteLine(jsonArr); + Connect(ip); UIController.OnIncomingMessages(ip, jsonArr); } } diff --git a/PolyChat/Models/ChatMessage.cs b/PolyChat/Models/ChatMessage.cs index 32e6f49..4056559 100644 --- a/PolyChat/Models/ChatMessage.cs +++ b/PolyChat/Models/ChatMessage.cs @@ -12,6 +12,11 @@ namespace PolyChat.Models public DateTime TimeStamp; public readonly bool Foreign; + + public ChatMessage() + { + + } /// /// Create own Message (directly sent) /// @@ -43,7 +48,7 @@ namespace PolyChat.Models Type = type; Content = content; Foreign = foreign; - Debug.WriteLine("Created Loaded Message: " + ToString()); + Debug.WriteLine("Created Loaded Message: " + ToString()); } override