[backend/federation] Include alt text for avatar and banner in UserRenderer
This commit is contained in:
parent
207249280f
commit
fdadc41c61
2 changed files with 5 additions and 3 deletions
|
@ -714,7 +714,9 @@ public static class QueryableExtensions
|
||||||
|
|
||||||
public static IQueryable<User> IncludeCommonProperties(this IQueryable<User> query)
|
public static IQueryable<User> IncludeCommonProperties(this IQueryable<User> query)
|
||||||
{
|
{
|
||||||
return query.Include(p => p.UserProfile);
|
return query.Include(p => p.UserProfile)
|
||||||
|
.Include(p => p.Avatar)
|
||||||
|
.Include(p => p.Banner);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IQueryable<Bite> IncludeCommonProperties(this IQueryable<Bite> query)
|
public static IQueryable<Bite> IncludeCommonProperties(this IQueryable<Bite> query)
|
||||||
|
|
|
@ -111,10 +111,10 @@ public class UserRenderer(
|
||||||
MovedTo = user.MovedToUri is not null ? new ASLink(user.MovedToUri) : null,
|
MovedTo = user.MovedToUri is not null ? new ASLink(user.MovedToUri) : null,
|
||||||
Featured = new ASOrderedCollection($"{id}/collections/featured"),
|
Featured = new ASOrderedCollection($"{id}/collections/featured"),
|
||||||
Avatar = user.Avatar != null
|
Avatar = user.Avatar != null
|
||||||
? new ASImage { Url = new ASLink(user.Avatar.RawAccessUrl) }
|
? new ASImage { Url = new ASLink(user.Avatar.RawAccessUrl), Description = user.Avatar?.Comment }
|
||||||
: null,
|
: null,
|
||||||
Banner = user.Banner != null
|
Banner = user.Banner != null
|
||||||
? new ASImage { Url = new ASLink(user.Banner.RawAccessUrl) }
|
? new ASImage { Url = new ASLink(user.Banner.RawAccessUrl), Description = user.Banner?.Comment }
|
||||||
: null,
|
: null,
|
||||||
Endpoints = new ASEndpoints { SharedInbox = new ASObjectBase($"https://{config.Value.WebDomain}/inbox") },
|
Endpoints = new ASEndpoints { SharedInbox = new ASObjectBase($"https://{config.Value.WebDomain}/inbox") },
|
||||||
PublicKey = new ASPublicKey
|
PublicKey = new ASPublicKey
|
||||||
|
|
Loading…
Add table
Reference in a new issue