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] Serialize Announce.published

Kopper 66c3ffb5 feb3e18a

+17 -8
+3 -2
Iceshrimp.Backend/Controllers/Federation/ActivityPubController.cs
··· 75 75 ASActivity activity = note is { IsPureRenote: true, Renote: not null } 76 76 ? ActivityPub.ActivityRenderer.RenderAnnounce(noteRenderer.RenderLite(note.Renote), 77 77 note.GetPublicUri(config.Value), noteActor, note.Visibility, 78 - note.User.GetPublicUri(config.Value) + "/followers") 78 + note.User.GetPublicUri(config.Value) + "/followers", 79 + note.CreatedAt) 79 80 : ActivityPub.ActivityRenderer.RenderCreate(await noteRenderer.RenderAsync(note), noteActor); 80 81 81 82 return activity.Compact(); ··· 249 250 ? (ASObject)ActivityPub.ActivityRenderer.RenderAnnounce(noteRenderer.RenderLite(note.Renote), 250 251 note.GetPublicUri(config.Value), noteActor, 251 252 note.Visibility, 252 - note.User.GetPublicUri(config.Value) + "/followers") 253 + note.User.GetPublicUri(config.Value) + "/followers", note.CreatedAt) 253 254 : ActivityPub.ActivityRenderer.RenderCreate(noteRenderer.RenderLite(note), noteActor)) 254 255 .ToList(); 255 256
+2 -1
Iceshrimp.Backend/Controllers/Web/AdminController.cs
··· 496 496 note.GetPublicUri(config.Value), 497 497 userRenderer.RenderLite(note.User), 498 498 note.Visibility, 499 - note.User.GetPublicUri(config.Value) + "/followers") 499 + note.User.GetPublicUri(config.Value) + "/followers", 500 + note.CreatedAt) 500 501 .Compact(); 501 502 } 502 503
+4 -3
Iceshrimp.Backend/Core/Federation/ActivityPub/ActivityRenderer.cs
··· 200 200 $"https://{config.Value.WebDomain}/follows/{follower.Id}/{followee.Id}/{(relationshipId ?? Guid.NewGuid()).ToStringLower()}"; 201 201 202 202 private static ASAnnounce RenderAnnounce( 203 - ASNote note, ASActor actor, List<ASObjectBase> to, List<ASObjectBase> cc, string uri 203 + ASNote note, ASActor actor, List<ASObjectBase> to, List<ASObjectBase> cc, string uri, DateTime publishedAt 204 204 ) => new() 205 205 { 206 206 Id = uri, 207 207 Actor = actor.Compact(), 208 208 Object = note, 209 + PublishedAt = publishedAt, 209 210 To = to, 210 211 Cc = cc 211 212 }; 212 213 213 214 public static ASAnnounce RenderAnnounce( 214 - ASNote note, string renoteUri, ASActor actor, Note.NoteVisibility visibility, string followersUri 215 + ASNote note, string renoteUri, ASActor actor, Note.NoteVisibility visibility, string followersUri, DateTime publishedAt 215 216 ) 216 217 { 217 218 List<ASObjectBase> to = visibility switch ··· 228 229 _ => [] 229 230 }; 230 231 231 - return RenderAnnounce(note, actor, to, cc, $"{renoteUri}/activity"); 232 + return RenderAnnounce(note, actor, to, cc, $"{renoteUri}/activity", publishedAt); 232 233 } 233 234 234 235 public ASNote RenderVote(PollVote vote, Poll poll, Note note) => new()
+4
Iceshrimp.Backend/Core/Federation/ActivityStreams/Types/ASActivity.cs
··· 91 91 92 92 [J($"{Constants.ActivityStreamsNs}#cc")] 93 93 public List<ASObjectBase>? Cc { get; set; } 94 + 95 + [J($"{Constants.ActivityStreamsNs}#published")] 96 + [JC(typeof(VC))] 97 + public DateTime? PublishedAt { get; set; } 94 98 95 99 public Note.NoteVisibility GetVisibility(User actor) 96 100 {
+4 -2
Iceshrimp.Backend/Core/Services/NoteService.cs
··· 481 481 : noteRenderer.RenderLite(note.Renote), 482 482 note.GetPublicUri(config.Value), actor, 483 483 note.Visibility, 484 - data.User.GetPublicUri(config.Value) + "/followers") 484 + data.User.GetPublicUri(config.Value) + "/followers", 485 + note.CreatedAt) 485 486 : ActivityPub.ActivityRenderer.RenderCreate(await noteRenderer.RenderAsync(note, mentions), actor); 486 487 487 488 List<string> additionalUserIds = ··· 899 900 ? activityRenderer.RenderUndo(actor, ActivityPub.ActivityRenderer.RenderAnnounce( 900 901 noteRenderer.RenderLite(note.Renote ?? throw new Exception("Refusing to undo renote without renote")), 901 902 note.GetPublicUri(config.Value), actor, note.Visibility, 902 - note.User.GetPublicUri(config.Value) + "/followers")) 903 + note.User.GetPublicUri(config.Value) + "/followers", 904 + note.CreatedAt)) 903 905 : ActivityPub.ActivityRenderer.RenderDelete(actor, new ASTombstone { Id = note.GetPublicUri(config.Value) }); 904 906 // @formatter:on 905 907