Added contenet embed to ChatMessage.cs

This commit is contained in:
JacobTech 2023-01-02 12:48:35 -05:00
parent d617e84f4c
commit 46fdd869da
1 changed files with 4 additions and 30 deletions

View File

@ -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));
}
}
}