From 77056cb7f333786f7253291b7f9f737db5b1b739 Mon Sep 17 00:00:00 2001 From: patricktbp <135556230+n1d3v@users.noreply.github.com> Date: Sat, 22 Jun 2024 08:56:39 +0100 Subject: [PATCH] ACTUALLY fix servers in #37 was a bug, nothing too special --- Naticord/Classes/WebSocketClientServer.cs | 8 +++++++- Naticord/Forms/Naticord.Designer.cs | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Naticord/Classes/WebSocketClientServer.cs b/Naticord/Classes/WebSocketClientServer.cs index d90ae48..840997c 100644 --- a/Naticord/Classes/WebSocketClientServer.cs +++ b/Naticord/Classes/WebSocketClientServer.cs @@ -95,6 +95,12 @@ private async void HandleMessageCreateEvent(JToken data) { dynamic eventData = data; string channelId = eventData["channel_id"]; + + if (channelId != parentServerForm.ChatID.ToString()) + { + return; + } + string author = eventData["author"]["global_name"] ?? eventData["author"]["username"]; string content = eventData["content"]; dynamic attachmentData = eventData["attachments"]; @@ -151,7 +157,7 @@ private async Task ProcessMessageAndUpdateChat(string author, string content, At bool found = false; try { - var messages = await parentServerForm.GetApiResponse($"channels/{parentServerForm.ChatID.ToString()}/messages"); + var messages = await parentServerForm.GetApiResponse($"channels/{parentServerForm.ChatID}/messages"); foreach (var message in messages) { diff --git a/Naticord/Forms/Naticord.Designer.cs b/Naticord/Forms/Naticord.Designer.cs index 17fe9b8..25c8502 100644 --- a/Naticord/Forms/Naticord.Designer.cs +++ b/Naticord/Forms/Naticord.Designer.cs @@ -113,7 +113,7 @@ private void InitializeComponent() this.friendsTab.Padding = new System.Windows.Forms.Padding(3); this.friendsTab.Size = new System.Drawing.Size(266, 371); this.friendsTab.TabIndex = 0; - this.friendsTab.Text = "DMs"; + this.friendsTab.Text = "Direct Messages"; this.friendsTab.UseVisualStyleBackColor = true; // // friendSearchBar