d26b9ab3b6
- Library: NewPostOptions factories for boost/poll/vote/migration/reaction; PostWriter emits new properties; ProfileWriter for header manipulation; OrgSocialPollVote model; RelayClient.fetchPollVotes/fetchGroupList/fetchGroupPostURLs - Tests: ProfileWriterTests (14), SpecialPostTests (17) — 117 total, all passing - App: ComposeView/ViewModel support poll options, poll end date, scheduled posts; PostRowView shows boost confirm, poll with vote bars, reaction/migration/visibility badges, mood; BoostViewModel, EditProfileViewModel with async load, GroupsViewModel; EditProfileView, GroupsView with group post list; ProfileView toolbar with follow/unfollow and edit button, pinned post section; full uploader support across all views; Groups tab in RootView
17 lines
525 B
Swift
17 lines
525 B
Swift
import Foundation
|
|
|
|
/// Vote counts for a single poll option, returned by the relay `/polls/votes/` endpoint.
|
|
public struct OrgSocialPollVote: Sendable, Equatable {
|
|
/// The text of the poll option (e.g. `"yes"`, `"Emacs"`).
|
|
public let option: String
|
|
/// URLs of the posts that voted for this option.
|
|
public let voterURLs: [String]
|
|
|
|
public var voteCount: Int { voterURLs.count }
|
|
|
|
public init(option: String, voterURLs: [String]) {
|
|
self.option = option
|
|
self.voterURLs = voterURLs
|
|
}
|
|
}
|