mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-27 21:24:42 +00:00
Validate serviceIds in pinned chats.
This commit is contained in:
committed by
Cody Henthorne
parent
d4c8c16df3
commit
af6518e3de
@@ -70,6 +70,7 @@ import org.thoughtcrime.securesms.util.JsonUtils.SaneJSONObject
|
||||
import org.thoughtcrime.securesms.util.LRUCache
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences
|
||||
import org.thoughtcrime.securesms.util.isScheduled
|
||||
import org.whispersystems.signalservice.api.push.ServiceId
|
||||
import org.whispersystems.signalservice.api.storage.SignalAccountRecord
|
||||
import org.whispersystems.signalservice.api.storage.SignalContactRecord
|
||||
import org.whispersystems.signalservice.api.storage.SignalGroupV1Record
|
||||
@@ -1546,7 +1547,12 @@ class ThreadTable(context: Context, databaseHelper: SignalDatabase) : DatabaseTa
|
||||
|
||||
for (pinned: AccountRecord.PinnedConversation in record.proto.pinnedConversations) {
|
||||
val pinnedRecipient: Recipient? = if (pinned.contact != null) {
|
||||
Recipient.externalPush(pinned.contact!!.toSignalServiceAddress())
|
||||
if (ServiceId.parseOrNull(pinned.contact!!.serviceId) != null) {
|
||||
Recipient.externalPush(pinned.contact!!.toSignalServiceAddress())
|
||||
} else {
|
||||
Log.w(TAG, "Failed to parse serviceId!")
|
||||
null
|
||||
}
|
||||
} else if (pinned.legacyGroupId != null) {
|
||||
try {
|
||||
Recipient.externalGroupExact(GroupId.v1(pinned.legacyGroupId!!.toByteArray()))
|
||||
|
||||
Reference in New Issue
Block a user