[backend/akko-api] Fix IsPleroma flag not being used correctly
This commit is contained in:
parent
2e911805de
commit
2c3a9d49b1
2 changed files with 9 additions and 7 deletions
|
@ -20,11 +20,10 @@ public class NoteRenderer(
|
|||
MfmConverter mfmConverter,
|
||||
DatabaseContext db,
|
||||
EmojiService emojiSvc,
|
||||
AttachmentRenderer attachmentRenderer
|
||||
AttachmentRenderer attachmentRenderer,
|
||||
FlagService flags
|
||||
) : IScopedService
|
||||
{
|
||||
public bool IsPleroma;
|
||||
|
||||
private static readonly FilterResultEntity InaccessibleFilter = new()
|
||||
{
|
||||
Filter = new FilterEntity
|
||||
|
@ -172,9 +171,11 @@ public class NoteRenderer(
|
|||
? (data?.Polls ?? await GetPollsAsync([note], user)).FirstOrDefault(p => p.Id == note.Id)
|
||||
: null;
|
||||
|
||||
var visibility = IsPleroma && note.LocalOnly ? "local" : StatusEntity.EncodeVisibility(note.Visibility);
|
||||
var visibility = flags.IsPleroma.Value && note.LocalOnly
|
||||
? "local"
|
||||
: StatusEntity.EncodeVisibility(note.Visibility);
|
||||
|
||||
var pleromaExtensions = IsPleroma
|
||||
var pleromaExtensions = flags.IsPleroma.Value
|
||||
? new PleromaStatusExtensions
|
||||
{
|
||||
LocalOnly = note.LocalOnly,
|
||||
|
|
|
@ -14,7 +14,8 @@ public class NotificationRenderer(
|
|||
IOptions<Config.InstanceSection> instance,
|
||||
DatabaseContext db,
|
||||
NoteRenderer noteRenderer,
|
||||
UserRenderer userRenderer
|
||||
UserRenderer userRenderer,
|
||||
FlagService flags
|
||||
) : IScopedService
|
||||
{
|
||||
public async Task<NotificationEntity> RenderAsync(
|
||||
|
@ -62,7 +63,7 @@ public class NotificationRenderer(
|
|||
CreatedAt = notification.CreatedAt.ToStringIso8601Like(),
|
||||
Emoji = notification.Reaction,
|
||||
EmojiUrl = emojiUrl,
|
||||
Pleroma = noteRenderer.IsPleroma ? new PleromaNotificationExtensions { IsSeen = notification.IsRead } : null
|
||||
Pleroma = flags.IsPleroma.Value ? new PleromaNotificationExtensions { IsSeen = notification.IsRead } : null
|
||||
};
|
||||
|
||||
return res;
|
||||
|
|
Loading…
Add table
Reference in a new issue