model.go 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. package renderer
  2. import (
  3. "bloat/mastodon"
  4. "bloat/model"
  5. )
  6. type Context struct {
  7. HideAttachments bool
  8. MaskNSFW bool
  9. FluorideMode bool
  10. ThreadInNewTab bool
  11. DarkMode bool
  12. CSRFToken string
  13. UserID string
  14. AntiDopamineMode bool
  15. InstanceEmojiFilter string
  16. AddReactionsFilter string
  17. UserCSS string
  18. Referrer string
  19. }
  20. type CommonData struct {
  21. Title string
  22. CustomCSS string
  23. CSRFToken string
  24. Count int
  25. RefreshInterval int
  26. Target string
  27. }
  28. type NavData struct {
  29. CommonData *CommonData
  30. User *mastodon.Account
  31. PostContext model.PostContext
  32. }
  33. type ErrorData struct {
  34. *CommonData
  35. Err string
  36. Retry bool
  37. SessionErr bool
  38. }
  39. type HomePageData struct {
  40. *CommonData
  41. }
  42. type SigninData struct {
  43. *CommonData
  44. }
  45. type RootData struct {
  46. Title string
  47. }
  48. type TimelineData struct {
  49. *CommonData
  50. Title string
  51. Type string
  52. Instance string
  53. InstanceType string
  54. Statuses []*mastodon.Status
  55. NextLink string
  56. PrevLink string
  57. }
  58. type ListsData struct {
  59. *CommonData
  60. Lists []*mastodon.List
  61. }
  62. type ListData struct {
  63. *CommonData
  64. List *mastodon.List
  65. Accounts []*mastodon.Account
  66. Q string
  67. SearchAccounts []*mastodon.Account
  68. }
  69. type ThreadData struct {
  70. *CommonData
  71. Statuses []*mastodon.Status
  72. PostContext model.PostContext
  73. ReplyMap map[string][]mastodon.ReplyInfo
  74. }
  75. type QuickReplyData struct {
  76. *CommonData
  77. Ancestor *mastodon.Status
  78. Status *mastodon.Status
  79. PostContext model.PostContext
  80. }
  81. type NotificationData struct {
  82. *CommonData
  83. Notifications []*mastodon.Notification
  84. UnreadCount int
  85. ReadID string
  86. NextLink string
  87. }
  88. type UserData struct {
  89. *CommonData
  90. User *mastodon.Account
  91. IsCurrent bool
  92. Type string
  93. Users []*mastodon.Account
  94. Statuses []*mastodon.Status
  95. NextLink string
  96. }
  97. type UserSearchData struct {
  98. *CommonData
  99. User *mastodon.Account
  100. Q string
  101. Statuses []*mastodon.Status
  102. NextLink string
  103. }
  104. type AboutData struct {
  105. *CommonData
  106. }
  107. type AboutInstanceData struct {
  108. *CommonData
  109. Instance *mastodon.Instance
  110. Peers []string
  111. }
  112. type EmojiData struct {
  113. *CommonData
  114. Emojis []*mastodon.Emoji
  115. }
  116. type LikedByData struct {
  117. *CommonData
  118. Users []*mastodon.Account
  119. NextLink string
  120. }
  121. //For Pleroma reactions
  122. type ReactedByData struct {
  123. *CommonData
  124. Reactions []*mastodon.ReactionsPleroma
  125. ReactionEmojis map[string]string
  126. ID string
  127. }
  128. type RetweetedByData struct {
  129. *CommonData
  130. Users []*mastodon.Account
  131. NextLink string
  132. }
  133. type SearchData struct {
  134. *CommonData
  135. Q string
  136. Type string
  137. Users []*mastodon.Account
  138. Statuses []*mastodon.Status
  139. NextLink string
  140. }
  141. type SettingsData struct {
  142. *CommonData
  143. Settings *model.Settings
  144. PostFormats []model.PostFormat
  145. }
  146. type FiltersData struct {
  147. *CommonData
  148. Filters []*mastodon.Filter
  149. }
  150. type ProfileData struct {
  151. *CommonData
  152. User *mastodon.Account
  153. }
  154. type MuteData struct {
  155. *CommonData
  156. User *mastodon.Account
  157. }