From 46fdd869dab91e8afed410dc5fbc8219a7f3f5cc Mon Sep 17 00:00:00 2001 From: JacobTech Date: Mon, 2 Jan 2023 12:48:35 -0500 Subject: [PATCH] Added contenet embed to ChatMessage.cs --- Luski/GUI/MainScreen/UI/ChatMessage.cs | 34 +++----------------------- 1 file changed, 4 insertions(+), 30 deletions(-) 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)); } } }