diff --git a/README.md b/README.md index a77ce62..1ef3de5 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,17 @@ are attachments of another user in the response). Github issue: [https://github.com/pixelfed/pixelfed/issues/4196](https://github.com/pixelfed/pixelfed/issues/4196) +### **Comments are not visible** +API is not returning comments added directly to the status (account `amiko`)? + +`[GET] https://pxlmo.com/api/v1/statuses/533554842410484883/context` + +Web app is using endpoint: `https://pxlmo.com/api/v2/statuses/533554842410484883/replies?limit=3` for downloading statuses. + +Comments are visible when we open status from another server (e.g. from https://pixelfed.social), because they are transfered +with the status via ActivityPub. + ### **Follow/unfollow hashtags is not available through the API** Pixelfed uses endpoint (POST): https://pixelfed.social/api/local/discover/tag/subscribe, with body: diff --git a/Vernissage/EnvironmentObjects/Client+Statuses.swift b/Vernissage/EnvironmentObjects/Client+Statuses.swift index 1da4033..06ebd9e 100644 --- a/Vernissage/EnvironmentObjects/Client+Statuses.swift +++ b/Vernissage/EnvironmentObjects/Client+Statuses.swift @@ -74,7 +74,7 @@ extension Client { private func getCommentDescendants(to statusId: String, showDivider: Bool, to commentViewModels: inout [CommentModel]) async throws { let context = try await pixelfedClient.getContext(for: statusId) - let descendants = context.descendants.toStatusViewModel() + let descendants = context.descendants.toStatusModels() for status in descendants { commentViewModels.append(CommentModel(status: status, showDivider: showDivider)) diff --git a/Vernissage/Models/StatusModel.swift b/Vernissage/Models/StatusModel.swift index dfe4b23..12b66dd 100644 --- a/Vernissage/Models/StatusModel.swift +++ b/Vernissage/Models/StatusModel.swift @@ -73,7 +73,7 @@ public class StatusModel: ObservableObject { self.commentsDisabled = orginalStatus.commentsDisabled var mediaAttachments: [AttachmentModel] = [] - for item in orginalStatus.mediaAttachments { + for item in orginalStatus.getAllImageMediaAttachments() { mediaAttachments.append(AttachmentModel(attachment: item)) } @@ -108,7 +108,7 @@ public extension StatusModel { } public extension [Status] { - func toStatusViewModel() -> [StatusModel] { + func toStatusModels() -> [StatusModel] { self .sorted(by: { lhs, rhs in lhs.id < rhs.id