Fixed mesage doubling issue

This commit is contained in:
ION606
2023-03-12 15:40:03 -04:00
parent 032e1de330
commit 8fcd5a60fc
+22 -21
View File
@@ -205,11 +205,11 @@ namespace Discord_Client_Custom.Channels
return; return;
} }
//JsonNode[] arr = new JsonNode[1]; // JsonNode[] arr = new JsonNode[1];
//arr[0] = response; // arr[0] = response;
//Add the message to chat in the app // Add the message to chat in the app
insertMessage(dmFlowContent, uMainIcon, response); // insertMessage(dmFlowContent, uMainIcon, response);
} }
else 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) public async void insertMessage(TableLayoutPanel dmFlowContent, string iconUrl, JsonNode? response)
{ {
Image avatar = (Image)(new Bitmap(await ChannelObj.getIconStream(iconUrl), new Size(32, 32))); 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<Image> getIcon() public async Task<Image> getIcon()
{ {
string iconUrl; string iconUrl;