diff --git a/ProjectLighthouse.Tests.GameApiTests/Unit/Activity/ActivityEventHandlerTests.cs b/ProjectLighthouse.Tests.GameApiTests/Unit/Activity/ActivityEventHandlerTests.cs index ccfcc134..6990c910 100644 --- a/ProjectLighthouse.Tests.GameApiTests/Unit/Activity/ActivityEventHandlerTests.cs +++ b/ProjectLighthouse.Tests.GameApiTests/Unit/Activity/ActivityEventHandlerTests.cs @@ -196,6 +196,7 @@ public class ActivityEventHandlerTests HeartedLevelId = 1, UserId = 1, SlotId = 1, + Slot = slot, }; eventHandler.OnEntityInserted(database, heartedLevel); diff --git a/ProjectLighthouse/Types/Activity/ActivityEntityEventHandler.cs b/ProjectLighthouse/Types/Activity/ActivityEntityEventHandler.cs index 33390375..f338f9f4 100644 --- a/ProjectLighthouse/Types/Activity/ActivityEntityEventHandler.cs +++ b/ProjectLighthouse/Types/Activity/ActivityEntityEventHandler.cs @@ -35,25 +35,44 @@ public class ActivityEntityEventHandler : IEntityEventHandler }, _ => null, }, - CommentEntity comment => comment.TargetSlot?.Type switch + CommentEntity comment => comment.Type switch { - SlotType.User => new CommentActivityEntity + CommentType.Level => comment.TargetSlot?.Type switch { - Type = comment.Type == CommentType.Level ? EventType.CommentOnLevel : EventType.CommentOnUser, + SlotType.User => new CommentActivityEntity + { + Type = EventType.CommentOnLevel, + CommentId = comment.CommentId, + UserId = comment.PosterUserId, + }, + _ => null, + }, + CommentType.Profile => new CommentActivityEntity + { + Type = EventType.CommentOnUser, CommentId = comment.CommentId, UserId = comment.PosterUserId, - }, + }, _ => null, }, - PhotoEntity photo => photo.Slot?.Type switch + PhotoEntity photo => photo.SlotId switch { - SlotType.User => new PhotoActivityEntity + null => new PhotoActivityEntity { Type = EventType.UploadPhoto, PhotoId = photo.PhotoId, UserId = photo.CreatorId, }, - _ => null, + _ => photo.Slot?.Type switch + { + SlotType.User => new PhotoActivityEntity + { + Type = EventType.UploadPhoto, + PhotoId = photo.PhotoId, + UserId = photo.CreatorId, + }, + _ => null, + }, }, ScoreEntity score => score.Slot.Type switch {