PollMessageDataSource
Functions
Link copied to clipboard
open suspend override fun getVote(conversationId: ConversationId, pollMessageId: MessageId, voterId: UserId): Either<StorageFailure, MessageContent.Poll.Vote?>
Link copied to clipboard
open suspend override fun recordVote(conversationId: ConversationId, pollMessageId: MessageId, vote: MessageContent.Poll.Vote): Either<StorageFailure, Boolean>
Stores vote as the voter's current selection when it is valid for the poll. Returns false without storing anything when the poll is unknown or the vote is invalid. A vote older than the voter's stored vote is ignored but still counts as valid.
Link copied to clipboard
open suspend override fun revertVote(conversationId: ConversationId, pollMessageId: MessageId, failedVote: MessageContent.Poll.Vote, previousVote: MessageContent.Poll.Vote?): Either<StorageFailure, Unit>
Undoes failedVote unless a newer vote has already replaced it.