mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 04:58:45 +00:00
Address validation error around calls with invalid ringers.
This commit is contained in:
committed by
jeffrey-signal
parent
dcbd4a3fc4
commit
3c27a690fd
@@ -127,6 +127,10 @@ object ExportSkips {
|
||||
return log(sentTimestamp, "A chat update that only makes sense for individual chats was found in a different kind of chat.")
|
||||
}
|
||||
|
||||
fun callWithMissingRecipient(sentTimestamp: Long): String {
|
||||
return log(sentTimestamp, "A call had a ringer with no matching exported Recipient.")
|
||||
}
|
||||
|
||||
private fun log(sentTimestamp: Long, message: String): String {
|
||||
return "[SKIP][$sentTimestamp] $message"
|
||||
}
|
||||
|
||||
@@ -747,7 +747,7 @@ private fun CallTable.Call.toRemoteCallUpdate(exportState: ExportState, messageR
|
||||
CallTable.Event.OUTGOING_RING -> GroupCall.State.OUTGOING_RING
|
||||
CallTable.Event.DELETE -> return null
|
||||
},
|
||||
ringerRecipientId = this.ringerRecipient?.toLong(),
|
||||
ringerRecipientId = this.ringerRecipient?.toLong()?.takeIf { exportState.recipientIdToAci[it] != null },
|
||||
startedCallRecipientId = groupCallUpdateDetails.startedCallUuid.takeIf { it.isNotEmpty() }?.let { exportState.aciToRecipientId[it] },
|
||||
startedCallTimestamp = this.timestamp.clampToValidBackupRange(),
|
||||
endedCallTimestamp = groupCallUpdateDetails.endedCallTimestamp.clampToValidBackupRange().takeIf { it > 0 },
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
package org.thoughtcrime.securesms.backup.v2.processor
|
||||
|
||||
import org.signal.core.util.logging.Log
|
||||
import org.thoughtcrime.securesms.backup.v2.ExportSkips
|
||||
import org.thoughtcrime.securesms.backup.v2.ExportState
|
||||
import org.thoughtcrime.securesms.backup.v2.ImportState
|
||||
import org.thoughtcrime.securesms.backup.v2.database.getAdhocCallsForBackup
|
||||
@@ -28,7 +29,7 @@ object AdHocCallArchiveProcessor {
|
||||
if (exportState.recipientIds.contains(callLog.recipientId)) {
|
||||
emitter.emit(Frame(adHocCall = callLog))
|
||||
} else {
|
||||
Log.w(TAG, "Dropping adhoc call for non-exported recipient.")
|
||||
Log.w(TAG, ExportSkips.callWithMissingRecipient(callLog.callTimestamp))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user