mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 09:20:19 +01:00
Fix issue with receiving server delivery receipts at PNI.
This commit is contained in:
@@ -31,7 +31,6 @@ import org.thoughtcrime.securesms.recipients.RecipientId
|
||||
import org.thoughtcrime.securesms.util.AppForegroundObserver
|
||||
import org.thoughtcrime.securesms.util.SignalLocalMetrics
|
||||
import org.whispersystems.signalservice.api.push.ServiceId
|
||||
import org.whispersystems.signalservice.api.util.UuidUtil
|
||||
import org.whispersystems.signalservice.api.websocket.WebSocketConnectionState
|
||||
import org.whispersystems.signalservice.api.websocket.WebSocketUnavailableException
|
||||
import org.whispersystems.signalservice.internal.push.Envelope
|
||||
@@ -319,12 +318,13 @@ class IncomingMessageObserver(private val context: Application) {
|
||||
}
|
||||
|
||||
private fun processReceipt(envelope: Envelope) {
|
||||
if (!UuidUtil.isUuid(envelope.sourceServiceId)) {
|
||||
Log.w(TAG, "Invalid envelope source UUID!")
|
||||
val serviceId = ServiceId.parseOrNull(envelope.sourceServiceId)
|
||||
if (serviceId == null) {
|
||||
Log.w(TAG, "Invalid envelope sourceServiceId!")
|
||||
return
|
||||
}
|
||||
|
||||
val senderId = RecipientId.from(ServiceId.parseOrThrow(envelope.sourceServiceId!!))
|
||||
val senderId = RecipientId.from(serviceId)
|
||||
|
||||
Log.i(TAG, "Received server receipt. Sender: $senderId, Device: ${envelope.sourceDevice}, Timestamp: ${envelope.timestamp}")
|
||||
SignalDatabase.messages.incrementDeliveryReceiptCount(envelope.timestamp!!, senderId, System.currentTimeMillis())
|
||||
|
||||
Reference in New Issue
Block a user