tuiter 2006
1package main
2
3import (
4 bsky "github.com/bluesky-social/indigo/api/bsky"
5)
6
7// Page data structs
8
9type PostStatusPageData struct {
10 Title string
11 CurrentUser *bsky.ActorDefs_ProfileViewDetailed
12 Profile *bsky.ActorDefs_ProfileViewDetailed
13 Follows []*bsky.ActorDefs_ProfileView
14 // SignedIn is the currently signed-in profile (typed, may be nil)
15 SignedIn *bsky.ActorDefs_ProfileViewDetailed
16}
17
18type TimelinePageData struct {
19 Title string
20 CurrentUser *bsky.ActorDefs_ProfileViewDetailed
21 Profile *bsky.ActorDefs_ProfileViewDetailed
22 Timeline *bsky.FeedGetTimeline_Output
23 Follows []*bsky.ActorDefs_ProfileView
24 Posts PostsList
25 PostBoxHandle string
26 // SignedIn is the currently signed-in profile (typed, may be nil)
27 SignedIn *bsky.ActorDefs_ProfileViewDetailed
28}
29
30type TimelinePartialData struct {
31 Timeline *bsky.FeedGetTimeline_Output
32 Posts PostsList
33 // SignedIn may be present for partials that need header links
34 SignedIn *bsky.ActorDefs_ProfileViewDetailed
35}
36
37type PostPageData struct {
38 Title string
39 Post *bsky.FeedDefs_PostView
40 Replies []*bsky.FeedDefs_PostView
41 ParentChain []*bsky.FeedDefs_PostView
42 ViewedURI string
43 ThreadRoot *bsky.FeedDefs_ThreadViewPost
44 CurrentUser *bsky.ActorDefs_ProfileViewDetailed
45 PostAuthor *bsky.ActorDefs_ProfileViewDetailed
46 PostAuthorFollows []*bsky.ActorDefs_ProfileView
47 // SignedIn is the currently signed-in profile (typed, may be nil)
48 SignedIn *bsky.ActorDefs_ProfileViewDetailed
49}
50
51type ProfilePageData struct {
52 Title string
53 Profile *bsky.ActorDefs_ProfileViewDetailed
54 Feed *bsky.FeedGetAuthorFeed_Output
55 Follows []*bsky.ActorDefs_ProfileView
56 Posts PostsList
57 PostBoxHandle string
58 // SignedIn is the currently signed-in profile (typed, may be nil)
59 SignedIn *bsky.ActorDefs_ProfileViewDetailed
60}
61
62type TimelineProvider struct{ T *bsky.FeedGetTimeline_Output }
63
64func (p TimelineProvider) Posts() []*bsky.FeedDefs_FeedViewPost {
65 if p.T == nil || p.T.Feed == nil {
66 return nil
67 }
68 return p.T.Feed
69}
70
71func (p TimelineProvider) Cursor() string {
72 if p.T == nil || p.T.Cursor == nil {
73 return ""
74 }
75 return *p.T.Cursor
76}
77
78type AuthorProvider struct {
79 F *bsky.FeedGetAuthorFeed_Output
80}
81
82func (p AuthorProvider) Posts() []*bsky.FeedDefs_FeedViewPost {
83 if p.F == nil || p.F.Feed == nil {
84 return nil
85 }
86 return p.F.Feed
87}
88
89func (p AuthorProvider) Cursor() string { return "" }