diff --git a/Luski/GUI/MainScreen/UI/ChatMessage.cs b/Luski/GUI/MainScreen/UI/ChatMessage.cs index a6e3ee5..d760e89 100644 --- a/Luski/GUI/MainScreen/UI/ChatMessage.cs +++ b/Luski/GUI/MainScreen/UI/ChatMessage.cs @@ -4,6 +4,7 @@ using GraphicsManager.Objects; using GraphicsManager.Objects.Core; using Luski.net.Interfaces; using Luski.net.JsonTypes; +using File = Luski.net.JsonTypes.File; namespace Luski.GUI.MainScreen.UI; @@ -24,23 +25,10 @@ public class ChatMessage : UserControl if (Msg.Files != null && Msg.Files.Length > 0) { - /* for (int i = 0; i < Msg.Files.Length; i++) { - File file = Msg.Files[i]; - ContentEmbed button = new(file, Msg.ChannelID); - if (InvokeRequired) - { - Invoke(new Action(() => - { - Controls.Add(button); - })); - } - else - { - Controls.Add(button); - } - }*/ + Controls.Add(new ContentEmbed(Msg.Files[i], Msg.ChannelID)); + } } DateTime time = new DateTime(2022, 1, 1, 0, 0, 0, 0).AddMilliseconds(Msg.Id >> 22).ToLocalTime(); @@ -78,21 +66,7 @@ public class ChatMessage : UserControl { for (int i = 0; i < msg.Files.Length; i++) { - //files example - /* - File file = msg.Files[i]; - ContentEmbed button = new(file, Msg.ChannelID); - if (InvokeRequired) - { - Invoke(new Action(() => - { - Controls.Add(button); - })); - } - else - { - Controls.Add(button); - }*/ + Controls.Add(new ContentEmbed(msg.Files[i], Msg.ChannelID)); } } }