checkpoint

This commit is contained in:
2026-10-28 13:23:35 +02:00
parent cce5e348b3
commit 33dad8ca5a
26 changed files with 1949 additions and 49 deletions
+3 -3
View File
@@ -7,8 +7,8 @@ public class PrivateMessage
{
public int Id { get; set; }
public bool Anonymous { get; set; }
public string? SenderId { get; set; }
public string SenderUsername { get; set; } = "";
[MaxLength(450)] public string? SenderId { get; set; }
[MaxLength(512)] public string SenderUsername { get; set; } = "";
[MaxLength(3000)] public string Body { get; set; } = "";
public DateTimeOffset CreatedAt { get; set; } = DateTimeOffset.UtcNow;
public bool IsRead { get; set; }
@@ -18,7 +18,7 @@ public class PrivateMessage
public PrivateMessage(string body, string userAgent)
{
CreatedAt = DateTime.UtcNow;
SenderUsername = userAgent + "___" + CreatedAt.ToString("dd-MM-yyyy___HH:mm:ss");
SenderUsername = userAgent[..Math.Min(userAgent.Length, 480)] + "___" + CreatedAt.ToString("dd-MM-yyyy___HH:mm:ss");
Anonymous = true;
SenderId = null;
Body = body;