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/federation] Set CanBite for remote users

pancakes ff671208 4f0446e8

+15 -1
+15 -1
Iceshrimp.Backend/Core/Services/UserService.cs
··· 173 173 174 174 var tags = ResolveHashtags(MfmParser.Parse(bio), actor); 175 175 176 + User.BiteControl? canBite = null; 177 + if (actor.CanBite?.Link == $"{Constants.ActivityStreamsNs}#Public") 178 + canBite = User.BiteControl.Public; 179 + else if (actor.Followers?.Id != null && actor.CanBite?.Link == actor.Followers?.Id) 180 + canBite = User.BiteControl.Followers; 181 + 176 182 user = new User 177 183 { 178 184 Id = IdHelpers.GenerateSnowflakeId(), ··· 199 205 //TODO: FollowersCount 200 206 //TODO: FollowingCount 201 207 Emojis = emoji.Select(p => p.Id).ToList(), 202 - Tags = tags 208 + Tags = tags, 209 + CanBite = canBite 203 210 }; 204 211 205 212 var profile = new UserProfile ··· 312 319 user.IsCat = actor.IsCat ?? false; 313 320 user.SpeakAsCat = actor.SpeakAsCat ?? actor.IsCat ?? false; 314 321 user.Featured = actor.Featured?.Id; 322 + 323 + User.BiteControl? canBite = null; 324 + if (actor.CanBite?.Link == $"{Constants.ActivityStreamsNs}#Public") 325 + canBite = User.BiteControl.Public; 326 + else if (user.FollowersUri != null && actor.CanBite?.Link == user.FollowersUri) 327 + canBite = User.BiteControl.Followers; 328 + user.CanBite = canBite; 315 329 316 330 var emoji = await emojiSvc.ProcessEmojiAsync(actor.Tags?.OfType<ASEmoji>().ToList(), 317 331 user.Host