iOS client for Grain grain.social
ios photography atproto
7
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: add StoryViewerState model and getStoryThread endpoint

Foundation for story comments — adds optional viewer state to GrainStory
(with fav tracking) and a getStoryThread XRPC endpoint that mirrors
getGalleryThread, reusing GetGalleryThreadResponse.

+17
+11
Grain/API/Endpoints/StoryEndpoints.swift
··· 35 35 func getStoryAuthors(auth: AuthContext? = nil) async throws -> GetStoryAuthorsResponse { 36 36 try await query("social.grain.unspecced.getStoryAuthors", auth: auth, as: GetStoryAuthorsResponse.self) 37 37 } 38 + 39 + func getStoryThread( 40 + story: String, 41 + limit: Int = 20, 42 + cursor: String? = nil, 43 + auth: AuthContext? = nil 44 + ) async throws -> GetGalleryThreadResponse { 45 + var params = ["story": story, "limit": String(limit)] 46 + if let cursor { params["cursor"] = cursor } 47 + return try await query("social.grain.unspecced.getStoryThread", params: params, auth: auth, as: GetGalleryThreadResponse.self) 48 + } 38 49 }
+6
Grain/Models/Views/StoryModels.swift
··· 13 13 let createdAt: String 14 14 var labels: [ATLabel]? 15 15 var crossPost: CrossPostInfo? 16 + var viewer: StoryViewerState? 16 17 17 18 var id: String { 18 19 uri ··· 24 25 } 25 26 26 27 extension GrainStory: StoryIdentifiable {} 28 + 29 + /// social.grain.story.defs#viewerState 30 + struct StoryViewerState: Codable, Sendable { 31 + var fav: String? 32 + } 27 33 28 34 /// social.grain.unspecced.getStoryAuthors#storyAuthor 29 35 struct GrainStoryAuthor: Codable, Sendable, Identifiable {