Update dependencies
This commit is contained in:
		
							parent
							
								
									f91ca82902
								
							
						
					
					
						commit
						d982633215
					
				@ -2946,6 +2946,9 @@
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
  "name":"org.whispersystems.signalservice.internal.storage.protos.AccountRecord$Companion"
 | 
					  "name":"org.whispersystems.signalservice.internal.storage.protos.AccountRecord$Companion"
 | 
				
			||||||
},
 | 
					},
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  "name":"org.whispersystems.signalservice.internal.storage.protos.AccountRecord$IAPSubscriberData"
 | 
				
			||||||
 | 
					},
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  "name":"org.whispersystems.signalservice.internal.storage.protos.AccountRecord$PhoneNumberSharingMode"
 | 
					  "name":"org.whispersystems.signalservice.internal.storage.protos.AccountRecord$PhoneNumberSharingMode"
 | 
				
			||||||
},
 | 
					},
 | 
				
			||||||
 | 
				
			|||||||
@ -8,10 +8,10 @@ argparse4j = "net.sourceforge.argparse4j:argparse4j:0.9.0"
 | 
				
			|||||||
dbusjava = "com.github.hypfvieh:dbus-java-transport-native-unixsocket:5.0.0"
 | 
					dbusjava = "com.github.hypfvieh:dbus-java-transport-native-unixsocket:5.0.0"
 | 
				
			||||||
slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" }
 | 
					slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" }
 | 
				
			||||||
slf4j-jul = { module = "org.slf4j:jul-to-slf4j", version.ref = "slf4j" }
 | 
					slf4j-jul = { module = "org.slf4j:jul-to-slf4j", version.ref = "slf4j" }
 | 
				
			||||||
logback = "ch.qos.logback:logback-classic:1.5.15"
 | 
					logback = "ch.qos.logback:logback-classic:1.5.16"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
signalservice = "com.github.turasa:signal-service-java:2.15.3_unofficial_114"
 | 
					signalservice = "com.github.turasa:signal-service-java:2.15.3_unofficial_115"
 | 
				
			||||||
sqlite = "org.xerial:sqlite-jdbc:3.47.1.0"
 | 
					sqlite = "org.xerial:sqlite-jdbc:3.47.2.0"
 | 
				
			||||||
hikari = "com.zaxxer:HikariCP:6.2.1"
 | 
					hikari = "com.zaxxer:HikariCP:6.2.1"
 | 
				
			||||||
junit-jupiter = "org.junit.jupiter:junit-jupiter:5.11.4"
 | 
					junit-jupiter = "org.junit.jupiter:junit-jupiter:5.11.4"
 | 
				
			||||||
junit-launcher = "org.junit.platform:junit-platform-launcher:1.11.4"
 | 
					junit-launcher = "org.junit.platform:junit-platform-launcher:1.11.4"
 | 
				
			||||||
 | 
				
			|||||||
@ -11,6 +11,7 @@ import org.signal.libsignal.zkgroup.profiles.ProfileKey;
 | 
				
			|||||||
import org.slf4j.Logger;
 | 
					import org.slf4j.Logger;
 | 
				
			||||||
import org.slf4j.LoggerFactory;
 | 
					import org.slf4j.LoggerFactory;
 | 
				
			||||||
import org.whispersystems.signalservice.api.push.UsernameLinkComponents;
 | 
					import org.whispersystems.signalservice.api.push.UsernameLinkComponents;
 | 
				
			||||||
 | 
					import org.whispersystems.signalservice.api.storage.IAPSubscriptionId;
 | 
				
			||||||
import org.whispersystems.signalservice.api.storage.SignalAccountRecord;
 | 
					import org.whispersystems.signalservice.api.storage.SignalAccountRecord;
 | 
				
			||||||
import org.whispersystems.signalservice.api.storage.StorageId;
 | 
					import org.whispersystems.signalservice.api.storage.StorageId;
 | 
				
			||||||
import org.whispersystems.signalservice.api.util.UuidUtil;
 | 
					import org.whispersystems.signalservice.api.util.UuidUtil;
 | 
				
			||||||
@ -22,8 +23,12 @@ import java.sql.SQLException;
 | 
				
			|||||||
import java.util.Arrays;
 | 
					import java.util.Arrays;
 | 
				
			||||||
import java.util.Optional;
 | 
					import java.util.Optional;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import okio.ByteString;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import static org.asamk.signal.manager.util.Utils.firstNonEmpty;
 | 
					import static org.asamk.signal.manager.util.Utils.firstNonEmpty;
 | 
				
			||||||
import static org.asamk.signal.manager.util.Utils.firstNonNull;
 | 
					import static org.whispersystems.signalservice.api.storage.AccountRecordExtensionsKt.safeSetBackupsSubscriber;
 | 
				
			||||||
 | 
					import static org.whispersystems.signalservice.api.storage.AccountRecordExtensionsKt.safeSetPayments;
 | 
				
			||||||
 | 
					import static org.whispersystems.signalservice.api.storage.AccountRecordExtensionsKt.safeSetSubscriber;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * Processes {@link SignalAccountRecord}s.
 | 
					 * Processes {@link SignalAccountRecord}s.
 | 
				
			||||||
@ -77,6 +82,35 @@ public class AccountRecordProcessor extends DefaultStorageRecordProcessor<Signal
 | 
				
			|||||||
            familyName = local.familyName;
 | 
					            familyName = local.familyName;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        final var payments = remote.payments != null && remote.payments.entropy.size() > 0
 | 
				
			||||||
 | 
					                ? remote.payments
 | 
				
			||||||
 | 
					                : local.payments;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        final ByteString donationSubscriberId;
 | 
				
			||||||
 | 
					        final String donationSubscriberCurrencyCode;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (remote.subscriberId.size() > 0) {
 | 
				
			||||||
 | 
					            donationSubscriberId = remote.subscriberId;
 | 
				
			||||||
 | 
					            donationSubscriberCurrencyCode = remote.subscriberCurrencyCode;
 | 
				
			||||||
 | 
					        } else {
 | 
				
			||||||
 | 
					            donationSubscriberId = local.subscriberId;
 | 
				
			||||||
 | 
					            donationSubscriberCurrencyCode = local.subscriberCurrencyCode;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        final ByteString backupsSubscriberId;
 | 
				
			||||||
 | 
					        final IAPSubscriptionId backupsPurchaseToken;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        final var remoteBackupSubscriberData = remote.backupSubscriberData;
 | 
				
			||||||
 | 
					        if (remoteBackupSubscriberData != null && remoteBackupSubscriberData.subscriberId.size() > 0) {
 | 
				
			||||||
 | 
					            backupsSubscriberId = remoteBackupSubscriberData.subscriberId;
 | 
				
			||||||
 | 
					            backupsPurchaseToken = IAPSubscriptionId.Companion.from(remoteBackupSubscriberData);
 | 
				
			||||||
 | 
					        } else {
 | 
				
			||||||
 | 
					            backupsSubscriberId = local.backupSubscriberData != null
 | 
				
			||||||
 | 
					                    ? local.backupSubscriberData.subscriberId
 | 
				
			||||||
 | 
					                    : ByteString.EMPTY;
 | 
				
			||||||
 | 
					            backupsPurchaseToken = IAPSubscriptionId.Companion.from(local.backupSubscriberData);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        final var mergedBuilder = SignalAccountRecord.Companion.newBuilder(remote.unknownFields().toByteArray())
 | 
					        final var mergedBuilder = SignalAccountRecord.Companion.newBuilder(remote.unknownFields().toByteArray())
 | 
				
			||||||
                .givenName(givenName)
 | 
					                .givenName(givenName)
 | 
				
			||||||
                .familyName(familyName)
 | 
					                .familyName(familyName)
 | 
				
			||||||
@ -96,9 +130,6 @@ public class AccountRecordProcessor extends DefaultStorageRecordProcessor<Signal
 | 
				
			|||||||
                .preferredReactionEmoji(firstNonEmpty(remote.preferredReactionEmoji, local.preferredReactionEmoji))
 | 
					                .preferredReactionEmoji(firstNonEmpty(remote.preferredReactionEmoji, local.preferredReactionEmoji))
 | 
				
			||||||
                .subscriberId(firstNonEmpty(remote.subscriberId, local.subscriberId))
 | 
					                .subscriberId(firstNonEmpty(remote.subscriberId, local.subscriberId))
 | 
				
			||||||
                .subscriberCurrencyCode(firstNonEmpty(remote.subscriberCurrencyCode, local.subscriberCurrencyCode))
 | 
					                .subscriberCurrencyCode(firstNonEmpty(remote.subscriberCurrencyCode, local.subscriberCurrencyCode))
 | 
				
			||||||
                .backupsSubscriberId(firstNonEmpty(remote.backupsSubscriberId, local.backupsSubscriberId))
 | 
					 | 
				
			||||||
                .backupsSubscriberCurrencyCode(firstNonEmpty(remote.backupsSubscriberCurrencyCode,
 | 
					 | 
				
			||||||
                        local.backupsSubscriberCurrencyCode))
 | 
					 | 
				
			||||||
                .displayBadgesOnProfile(remote.displayBadgesOnProfile)
 | 
					                .displayBadgesOnProfile(remote.displayBadgesOnProfile)
 | 
				
			||||||
                .subscriptionManuallyCancelled(remote.subscriptionManuallyCancelled)
 | 
					                .subscriptionManuallyCancelled(remote.subscriptionManuallyCancelled)
 | 
				
			||||||
                .keepMutedChatsArchived(remote.keepMutedChatsArchived)
 | 
					                .keepMutedChatsArchived(remote.keepMutedChatsArchived)
 | 
				
			||||||
@ -115,9 +146,12 @@ public class AccountRecordProcessor extends DefaultStorageRecordProcessor<Signal
 | 
				
			|||||||
                .username(remote.username)
 | 
					                .username(remote.username)
 | 
				
			||||||
                .usernameLink(remote.usernameLink)
 | 
					                .usernameLink(remote.usernameLink)
 | 
				
			||||||
                .e164(account.isPrimaryDevice() ? local.e164 : remote.e164);
 | 
					                .e164(account.isPrimaryDevice() ? local.e164 : remote.e164);
 | 
				
			||||||
        if (firstNonNull(remote.payments, local.payments) != null) {
 | 
					        safeSetPayments(mergedBuilder,
 | 
				
			||||||
            mergedBuilder.payments(firstNonNull(remote.payments, local.payments));
 | 
					                payments != null && payments.enabled,
 | 
				
			||||||
        }
 | 
					                payments == null ? null : payments.entropy.toByteArray());
 | 
				
			||||||
 | 
					        safeSetSubscriber(mergedBuilder, donationSubscriberId, donationSubscriberCurrencyCode);
 | 
				
			||||||
 | 
					        safeSetBackupsSubscriber(mergedBuilder, backupsSubscriberId, backupsPurchaseToken);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        final var merged = mergedBuilder.build();
 | 
					        final var merged = mergedBuilder.build();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        final var matchesRemote = doProtosMatch(merged, remote);
 | 
					        final var matchesRemote = doProtosMatch(merged, remote);
 | 
				
			||||||
 | 
				
			|||||||
@ -8,7 +8,7 @@ import java.sql.SQLException;
 | 
				
			|||||||
 * Handles processing a remote record, which involves applying any local changes that need to be
 | 
					 * Handles processing a remote record, which involves applying any local changes that need to be
 | 
				
			||||||
 * made based on the remote records.
 | 
					 * made based on the remote records.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
interface StorageRecordProcessor<E extends SignalRecord> {
 | 
					interface StorageRecordProcessor<E extends SignalRecord<?>> {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    void process(E remoteRecord) throws SQLException;
 | 
					    void process(E remoteRecord) throws SQLException;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -5,7 +5,7 @@ import org.whispersystems.signalservice.api.storage.SignalRecord;
 | 
				
			|||||||
/**
 | 
					/**
 | 
				
			||||||
 * Represents a pair of records: one old, and one new. The new record should replace the old.
 | 
					 * Represents a pair of records: one old, and one new. The new record should replace the old.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
record StorageRecordUpdate<E extends SignalRecord>(E oldRecord, E newRecord) {
 | 
					record StorageRecordUpdate<E extends SignalRecord<?>>(E oldRecord, E newRecord) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public String toString() {
 | 
					    public String toString() {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user