fix connection establishment when loading files

This commit is contained in:
SCM6WE
2021-09-23 11:09:43 +02:00
committed by Felix Hartmann (PEA3-Fe-FI)
parent a953d34122
commit e27141e013
2 changed files with 9 additions and 1 deletions

View File

@@ -166,6 +166,8 @@ namespace PolyChat
/// <param name="ip"></param> /// <param name="ip"></param>
public void loadChats() public void loadChats()
{ {
//load dir and create if non existant //load dir and create if non existant
if (Directory.Exists("U:\\PolyChat\\Saves")) if (Directory.Exists("U:\\PolyChat\\Saves"))
{ {
@@ -190,6 +192,7 @@ namespace PolyChat
ip = ip.Substring(0, ip.Length - 4); ip = ip.Substring(0, ip.Length - 4);
Debug.WriteLine("-" + ip + "-"); Debug.WriteLine("-" + ip + "-");
Debug.WriteLine(jsonArr); Debug.WriteLine(jsonArr);
Connect(ip);
UIController.OnIncomingMessages(ip, jsonArr); UIController.OnIncomingMessages(ip, jsonArr);
} }
} }

View File

@@ -12,6 +12,11 @@ namespace PolyChat.Models
public DateTime TimeStamp; public DateTime TimeStamp;
public readonly bool Foreign; public readonly bool Foreign;
public ChatMessage()
{
}
/// <summary> /// <summary>
/// Create own Message (directly sent) /// Create own Message (directly sent)
/// </summary> /// </summary>
@@ -43,7 +48,7 @@ namespace PolyChat.Models
Type = type; Type = type;
Content = content; Content = content;
Foreign = foreign; Foreign = foreign;
Debug.WriteLine("Created Loaded Message: " + ToString()); Debug.WriteLine("Created Loaded Message: " + ToString());
} }
override override