mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-20 02:58:45 +00:00
Fix possible invalid poll export.
This commit is contained in:
committed by
jeffrey-signal
parent
464345ee5f
commit
ab5426e6bb
@@ -135,6 +135,10 @@ object ExportSkips {
|
||||
return log(sentTimestamp, "Poll option was invalid.")
|
||||
}
|
||||
|
||||
fun pollNotInGroupChat(sentTimestamp: Long): String {
|
||||
return log(sentTimestamp, "Poll was not in a group chat.")
|
||||
}
|
||||
|
||||
fun individualChatUpdateInWrongTypeOfChat(sentTimestamp: Long): String {
|
||||
return log(sentTimestamp, "A chat update that only makes sense for individual chats was found in a different kind of chat.")
|
||||
}
|
||||
|
||||
@@ -395,6 +395,11 @@ class ChatItemArchiveExporter(
|
||||
}
|
||||
|
||||
extraData.pollsById[record.id] != null -> {
|
||||
if (exportState.threadIdToRecipientId[builder.chatId] !in exportState.groupRecipientIds) {
|
||||
Log.w(TAG, ExportSkips.pollNotInGroupChat(record.dateSent))
|
||||
continue
|
||||
}
|
||||
|
||||
val poll = extraData.pollsById[record.id]!!
|
||||
if (poll.question.isEmpty() || poll.question.length > MAX_POLL_CHARACTER_LENGTH) {
|
||||
Log.w(TAG, ExportSkips.invalidPollQuestion(record.dateSent))
|
||||
|
||||
Reference in New Issue
Block a user