From 8fcd5a60fc3669138a5dc1a7add391bc59aa2b7b Mon Sep 17 00:00:00 2001 From: ION606 Date: Sun, 12 Mar 2023 15:40:03 -0400 Subject: [PATCH] Fixed mesage doubling issue --- Channels/ChannelObj.cs | 43 +++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/Channels/ChannelObj.cs b/Channels/ChannelObj.cs index 7eb39c0..c4abf5b 100644 --- a/Channels/ChannelObj.cs +++ b/Channels/ChannelObj.cs @@ -205,11 +205,11 @@ namespace Discord_Client_Custom.Channels return; } - //JsonNode[] arr = new JsonNode[1]; - //arr[0] = response; + // JsonNode[] arr = new JsonNode[1]; + // arr[0] = response; - //Add the message to chat in the app - insertMessage(dmFlowContent, uMainIcon, response); + // Add the message to chat in the app + // insertMessage(dmFlowContent, uMainIcon, response); } else { @@ -243,6 +243,24 @@ namespace Discord_Client_Custom.Channels } + + public string getName() + { + if (cname != null) + { + return cname; + } + + return users[0].getUserName(); + } + + + public string getId() + { + return cid; + } + + public async void insertMessage(TableLayoutPanel dmFlowContent, string iconUrl, JsonNode? response) { Image avatar = (Image)(new Bitmap(await ChannelObj.getIconStream(iconUrl), new Size(32, 32))); @@ -273,23 +291,6 @@ namespace Discord_Client_Custom.Channels } - public string getName() - { - if (cname != null) - { - return cname; - } - - return users[0].getUserName(); - } - - - public string getId() - { - return cid; - } - - public async Task getIcon() { string iconUrl;