~ knotless Search/
↑↓ move↵ open⇧↵ all results

grain.social/grain-ios

1 collaborator
0
1
main
59 lines · 1.5 KB Raw History
import Foundation

/// social.grain.actor.defs#profileView
struct GrainProfile: Codable, Sendable, Identifiable {
    /// The profile record's CID: absent for an account with no grain
    /// profile indexed, which the lexicon allows.
    let cid: String?
    let did: String
    let handle: String
    var displayName: String?
    var description: String?
    var labels: [ATLabel]?
    var avatar: String?
    var createdAt: String?

    var id: String {
        did
    }
}

/// social.grain.actor.defs#profileViewDetailed
struct GrainProfileDetailed: Codable, Sendable, Identifiable {
    /// The profile record's CID: absent for an account with no grain
    /// profile indexed, which the lexicon allows.
    let cid: String?
    let did: String
    let handle: String
    var displayName: String?
    var description: String?
    var avatar: String?
    var cameras: [String]?
    var followersCount: Int?
    var followsCount: Int?
    var galleryCount: Int?
    var indexedAt: String?
    var createdAt: String?
    var viewer: ActorViewerState?
    var labels: [ATLabel]?
    var messageMe: MessageMe?

    var id: String {
        did
    }
}

/// social.grain.actor.defs#viewerState
struct ActorViewerState: Codable, Sendable {
    var following: String?
    var followedBy: String?
    var blocking: String?
    var blockedBy: Bool?
    var muted: Bool?
}

/// Germ Network messageMe declaration
struct MessageMe: Codable, Sendable {
    let showButtonTo: String
    let messageMeUrl: String
}