mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-08-17 07:50:20 +00:00
Fix score, photo, and comment activities
This commit is contained in:
parent
15dbf562aa
commit
0c9c8fd7b2
2 changed files with 27 additions and 7 deletions
|
@ -196,6 +196,7 @@ public class ActivityEventHandlerTests
|
||||||
HeartedLevelId = 1,
|
HeartedLevelId = 1,
|
||||||
UserId = 1,
|
UserId = 1,
|
||||||
SlotId = 1,
|
SlotId = 1,
|
||||||
|
Slot = slot,
|
||||||
};
|
};
|
||||||
|
|
||||||
eventHandler.OnEntityInserted(database, heartedLevel);
|
eventHandler.OnEntityInserted(database, heartedLevel);
|
||||||
|
|
|
@ -35,17 +35,35 @@ public class ActivityEntityEventHandler : IEntityEventHandler
|
||||||
},
|
},
|
||||||
_ => null,
|
_ => null,
|
||||||
},
|
},
|
||||||
CommentEntity comment => comment.TargetSlot?.Type switch
|
CommentEntity comment => comment.Type switch
|
||||||
|
{
|
||||||
|
CommentType.Level => comment.TargetSlot?.Type switch
|
||||||
{
|
{
|
||||||
SlotType.User => new CommentActivityEntity
|
SlotType.User => new CommentActivityEntity
|
||||||
{
|
{
|
||||||
Type = comment.Type == CommentType.Level ? EventType.CommentOnLevel : EventType.CommentOnUser,
|
Type = EventType.CommentOnLevel,
|
||||||
CommentId = comment.CommentId,
|
CommentId = comment.CommentId,
|
||||||
UserId = comment.PosterUserId,
|
UserId = comment.PosterUserId,
|
||||||
},
|
},
|
||||||
_ => null,
|
_ => null,
|
||||||
},
|
},
|
||||||
PhotoEntity photo => photo.Slot?.Type switch
|
CommentType.Profile => new CommentActivityEntity
|
||||||
|
{
|
||||||
|
Type = EventType.CommentOnUser,
|
||||||
|
CommentId = comment.CommentId,
|
||||||
|
UserId = comment.PosterUserId,
|
||||||
|
},
|
||||||
|
_ => null,
|
||||||
|
},
|
||||||
|
PhotoEntity photo => photo.SlotId switch
|
||||||
|
{
|
||||||
|
null => new PhotoActivityEntity
|
||||||
|
{
|
||||||
|
Type = EventType.UploadPhoto,
|
||||||
|
PhotoId = photo.PhotoId,
|
||||||
|
UserId = photo.CreatorId,
|
||||||
|
},
|
||||||
|
_ => photo.Slot?.Type switch
|
||||||
{
|
{
|
||||||
SlotType.User => new PhotoActivityEntity
|
SlotType.User => new PhotoActivityEntity
|
||||||
{
|
{
|
||||||
|
@ -55,6 +73,7 @@ public class ActivityEntityEventHandler : IEntityEventHandler
|
||||||
},
|
},
|
||||||
_ => null,
|
_ => null,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
ScoreEntity score => score.Slot.Type switch
|
ScoreEntity score => score.Slot.Type switch
|
||||||
{
|
{
|
||||||
// Don't add story scores or versus scores
|
// Don't add story scores or versus scores
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue