kopia lustrzana https://github.com/ryukoposting/Signal-Android
Fix corner case in story distribution list syncing.
rodzic
9ceb5b2e85
commit
8da66bc789
|
@ -85,6 +85,7 @@ import org.thoughtcrime.securesms.storage.StorageRecordUpdate
|
||||||
import org.thoughtcrime.securesms.storage.StorageSyncHelper
|
import org.thoughtcrime.securesms.storage.StorageSyncHelper
|
||||||
import org.thoughtcrime.securesms.storage.StorageSyncModels
|
import org.thoughtcrime.securesms.storage.StorageSyncModels
|
||||||
import org.thoughtcrime.securesms.util.Base64
|
import org.thoughtcrime.securesms.util.Base64
|
||||||
|
import org.thoughtcrime.securesms.util.FeatureFlags
|
||||||
import org.thoughtcrime.securesms.util.GroupUtil
|
import org.thoughtcrime.securesms.util.GroupUtil
|
||||||
import org.thoughtcrime.securesms.util.IdentityUtil
|
import org.thoughtcrime.securesms.util.IdentityUtil
|
||||||
import org.thoughtcrime.securesms.util.ProfileUtil
|
import org.thoughtcrime.securesms.util.ProfileUtil
|
||||||
|
@ -1093,7 +1094,7 @@ open class RecipientDatabase(context: Context, databaseHelper: SignalDatabase) :
|
||||||
* @return All storage IDs for synced records, excluding the ones that need to be deleted.
|
* @return All storage IDs for synced records, excluding the ones that need to be deleted.
|
||||||
*/
|
*/
|
||||||
fun getContactStorageSyncIdsMap(): Map<RecipientId, StorageId> {
|
fun getContactStorageSyncIdsMap(): Map<RecipientId, StorageId> {
|
||||||
val (inPart, args) = if (Recipient.self().storiesCapability == Recipient.Capability.SUPPORTED) {
|
val (inPart, args) = if (FeatureFlags.stories() && Recipient.self().storiesCapability == Recipient.Capability.SUPPORTED) {
|
||||||
"(?, ?)" to SqlUtil.buildArgs(GroupType.NONE.id, Recipient.self().id, GroupType.SIGNAL_V1.id, GroupType.DISTRIBUTION_LIST.id)
|
"(?, ?)" to SqlUtil.buildArgs(GroupType.NONE.id, Recipient.self().id, GroupType.SIGNAL_V1.id, GroupType.DISTRIBUTION_LIST.id)
|
||||||
} else {
|
} else {
|
||||||
"(?)" to SqlUtil.buildArgs(GroupType.NONE.id, Recipient.self().id, GroupType.SIGNAL_V1.id)
|
"(?)" to SqlUtil.buildArgs(GroupType.NONE.id, Recipient.self().id, GroupType.SIGNAL_V1.id)
|
||||||
|
|
|
@ -448,8 +448,10 @@ public class StorageSyncJob extends BaseJob {
|
||||||
if (record.getDistributionListId() != null) {
|
if (record.getDistributionListId() != null) {
|
||||||
records.add(StorageSyncModels.localToRemoteRecord(record));
|
records.add(StorageSyncModels.localToRemoteRecord(record));
|
||||||
} else {
|
} else {
|
||||||
throw new MissingRecipientModelError("Missing local recipient model! Type: " + id.getType());
|
throw new MissingRecipientModelError("Missing local recipient model (no DistributionListId)! Type: " + id.getType());
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
throw new MissingRecipientModelError("Missing local recipient model! Type: " + id.getType());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
Ładowanie…
Reference in New Issue