notify server changes + logging changes

This commit is contained in:
Lapis
2026-04-04 08:03:07 -04:00
parent 284db74d0e
commit 7ad2549a17
6 changed files with 34 additions and 12 deletions
+9
View File
@@ -0,0 +1,9 @@
namespace CannedNet;
public enum JoinMode
{
Default = 0,
CreateIfNotExists = 1,
JoinOrRejoin = 2,
RejoinOnly = 3
}
+11
View File
@@ -0,0 +1,11 @@
namespace CannedNet;
public enum ModerationState
{
Active = 0,
Junior_Pending = 1,
Moderation_Pending = 2,
Moderation_Closed = 3,
Moderation_Banned = 4,
MarkedForDelete = 5
}
+3 -3
View File
@@ -8,7 +8,7 @@ public class NotificationMessage
public string? NotificationId { get; set; }
[JsonPropertyName("notificationType")]
public string? NotificationType { get; set; }
public PushNotificationId? NotificationType { get; set; }
[JsonPropertyName("id")]
public int? Id { get; set; }
@@ -95,7 +95,7 @@ public class RelationshipChangedNotification
public int? AccountId { get; set; }
[JsonPropertyName("relationshipType")]
public string? RelationshipType { get; set; }
public RelationshipType? RelationshipType { get; set; }
[JsonPropertyName("status")]
public string? Status { get; set; }
@@ -227,5 +227,5 @@ public class InventionModerationNotification
public string? InventionId { get; set; }
[JsonPropertyName("moderationState")]
public string? ModerationState { get; set; }
public ModerationState? ModerationState { get; set; }
}
+9
View File
@@ -0,0 +1,9 @@
namespace CannedNet;
public enum RelationshipType
{
None,
FriendRequestSent,
FriendRequestReceived,
Friend
}
+1 -1
View File
@@ -101,7 +101,7 @@ public class NotificationService
await hubContext.Clients.All.SendAsync("Notification", notification);
}
public NotificationMessage CreateNotification(string notificationType, int? id = null, int? fromAccountId = null, int? toAccountId = null, Dictionary<string, object>? data = null)
public NotificationMessage CreateNotification(PushNotificationId notificationType, int? id = null, int? fromAccountId = null, int? toAccountId = null, Dictionary<string, object>? data = null)
{
return new NotificationMessage
{
@@ -58,14 +58,7 @@ public class RequestLoggingMiddleware
private static bool IsSensitiveHeader(string headerName)
{
var sensitiveHeaders = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
{
"Authorization",
"Cookie",
"Set-Cookie",
"X-Auth-Token",
"X-Csrf-Token"
};
var sensitiveHeaders = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { };
return sensitiveHeaders.Contains(headerName);
}
}