mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-20 16:49:40 +01:00
Fix poll bugs.
This commit is contained in:
@@ -244,7 +244,7 @@ private fun PollOption(
|
||||
}
|
||||
|
||||
Column {
|
||||
Row(verticalAlignment = Alignment.Bottom) {
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
Text(
|
||||
text = option.text,
|
||||
style = MaterialTheme.typography.bodyLarge.copy(fontSize = fontSize.sp),
|
||||
|
||||
@@ -2228,6 +2228,7 @@ open class MessageTable(context: Context?, databaseHelper: SignalDatabase) : Dat
|
||||
reactions.deleteReactions(MessageId(messageId))
|
||||
deleteGroupStoryReplies(messageId)
|
||||
disassociateStoryQuotes(messageId)
|
||||
polls.deletePoll(messageId)
|
||||
disassociatePollFromPollTerminate(polls.getPollTerminateMessageId(messageId))
|
||||
|
||||
val threadId = getThreadIdForMessage(messageId)
|
||||
|
||||
@@ -700,6 +700,13 @@ class PollTables(context: Context?, databaseHelper: SignalDatabase?) : DatabaseT
|
||||
.readToSingleBoolean()
|
||||
}
|
||||
|
||||
fun deletePoll(messageId: Long) {
|
||||
writableDatabase
|
||||
.delete(PollTable.TABLE_NAME)
|
||||
.where("${PollTable.MESSAGE_ID} = ?", messageId)
|
||||
.run()
|
||||
}
|
||||
|
||||
private fun isPending(pollId: Long, optionId: Long, voterId: Long): Boolean {
|
||||
return readableDatabase
|
||||
.exists(PollVoteTable.TABLE_NAME)
|
||||
|
||||
Reference in New Issue
Block a user