From 425245fd07df30f6dff4801f9d00da57c27c931e Mon Sep 17 00:00:00 2001 From: Slendy Date: Sat, 17 Jun 2023 15:11:26 -0500 Subject: [PATCH] Prevent users from hearting themselves --- ProjectLighthouse/Database/DatabaseContext.Utils.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ProjectLighthouse/Database/DatabaseContext.Utils.cs b/ProjectLighthouse/Database/DatabaseContext.Utils.cs index f9e2e046..939f978d 100644 --- a/ProjectLighthouse/Database/DatabaseContext.Utils.cs +++ b/ProjectLighthouse/Database/DatabaseContext.Utils.cs @@ -122,6 +122,8 @@ public partial class DatabaseContext public async Task HeartUser(int userId, UserEntity heartedUser) { + if (userId == heartedUser.UserId) return; + HeartedProfileEntity? heartedProfile = await this.HeartedProfiles.FirstOrDefaultAsync(q => q.UserId == userId && q.HeartedUserId == heartedUser.UserId); if (heartedProfile != null) return;