From 143037165ad200ec34c1ef50a099f109cdb5e887 Mon Sep 17 00:00:00 2001 From: cake Date: Tue, 16 Dec 2025 07:06:17 +0100 Subject: [PATCH] Reduced amount of chats, commented out the pending report. --- .../LightlessSyncServer/Hubs/LightlessHub.Chat.cs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/LightlessSyncServer/LightlessSyncServer/Hubs/LightlessHub.Chat.cs b/LightlessSyncServer/LightlessSyncServer/Hubs/LightlessHub.Chat.cs index 9fcabf0..120885e 100644 --- a/LightlessSyncServer/LightlessSyncServer/Hubs/LightlessHub.Chat.cs +++ b/LightlessSyncServer/LightlessSyncServer/Hubs/LightlessHub.Chat.cs @@ -1,13 +1,9 @@ -using System; using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Linq; using System.Text.Json; using LightlessSync.API.Data.Enum; using LightlessSync.API.Dto.Chat; using LightlessSync.API.Dto.User; using LightlessSyncServer.Models; -using LightlessSyncServer.Services; using LightlessSyncServer.Utils; using LightlessSyncShared.Models; using Microsoft.AspNetCore.Authorization; @@ -18,7 +14,7 @@ namespace LightlessSyncServer.Hubs; public partial class LightlessHub { - private const int MaxChatMessageLength = 400; + private const int MaxChatMessageLength = 200; private const int ChatRateLimitMessages = 7; private static readonly TimeSpan ChatRateLimitWindow = TimeSpan.FromMinutes(1); private static readonly ConcurrentDictionary ChatRateLimiters = new(StringComparer.Ordinal); @@ -67,7 +63,7 @@ public partial class LightlessHub descriptor, displayName, g.GID, - g.OwnerUID == userUid); + string.Equals(g.OwnerUID, userUid, StringComparison.Ordinal)); }) .OrderBy(info => info.DisplayName, StringComparer.OrdinalIgnoreCase) .ToList(); @@ -406,7 +402,7 @@ public partial class LightlessHub return; } - if (!string.IsNullOrEmpty(messageEntry.SenderUserUid)) + /* if (!string.IsNullOrEmpty(messageEntry.SenderUserUid)) { var targetAlreadyPending = await DbContext.ReportedChatMessages .AsNoTracking() @@ -418,7 +414,7 @@ public partial class LightlessHub await Clients.Caller.Client_ReceiveServerMessage(MessageSeverity.Information, "This user already has a report pending review.").ConfigureAwait(false); return; } - } + } */ var snapshotEntries = _chatChannelService.GetRecentMessages(messageEntry.Channel, 25); var snapshotItems = snapshotEntries