a fork of iceshrimp.net but a tweaked frontend to my personal liking. waow
fediverse social-media social iceshrimp fedi
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

[backend/web] Include CanBite in user profile relations

pancakes aeafa96a ff671208

+11 -3
+9 -2
Iceshrimp.Backend/Controllers/Web/Renderers/UserProfileRenderer.cs
··· 23 23 IsBlocking = false, 24 24 IsMuting = false, 25 25 IsRequested = false, 26 - IsRequestedBy = false 26 + IsRequestedBy = false, 27 + CanBite = false 27 28 }; 28 29 29 30 var ffVisibility = user.UserProfile?.FFVisibility ?? UserProfile.UserProfileFFVisibility.Public; ··· 98 99 IsBlocking = p.IsBlockedBy(localUser), 99 100 IsMuting = p.IsMutedBy(localUser), 100 101 IsRequested = p.IsRequestedBy(localUser), 101 - IsRequestedBy = p.IsRequested(localUser) 102 + IsRequestedBy = p.IsRequested(localUser), 103 + CanBite = p.Id != localUser.Id 104 + && (p.CanBite == User.BiteControl.Public 105 + || (p.CanBite == User.BiteControl.Followers 106 + && p.IsFollowedBy(localUser))) 102 107 }) 103 108 .ToDictionaryAsync(p => p.UserId, p => p); 104 109 } ··· 127 132 128 133 public class RelationData 129 134 { 135 + public required bool CanBite; 130 136 public required bool IsBlocking; 131 137 public required bool IsFollowedBy; 132 138 public required bool IsFollowing; ··· 146 152 if (data.IsRequestedBy) res |= Relations.RequestedBy; 147 153 if (data.IsBlocking) res |= Relations.Blocking; 148 154 if (data.IsMuting) res |= Relations.Muting; 155 + if (data.CanBite) res |= Relations.CanBite; 149 156 return res; 150 157 } 151 158 }
+2 -1
Iceshrimp.Shared/Schemas/Web/UserProfileResponse.cs
··· 33 33 Requested = 8, 34 34 RequestedBy = 16, 35 35 Blocking = 32, 36 - Muting = 64 36 + Muting = 64, 37 + CanBite = 128 37 38 } 38 39 39 40 public enum Role