Rename blocked timestamp.

This commit is contained in:
Michelle Tang
2026-08-19 19:05:50 -04:00
committed by Cody Henthorne
parent e4216b9d05
commit fb0345ff48
10 changed files with 14 additions and 14 deletions
@@ -75,7 +75,7 @@ class ContactArchiveExporter(private val cursor: Cursor, private val selfId: Lon
.username(cursor.requireString(RecipientTable.USERNAME)?.takeIf { it.isValidUsername() })
.e164(cursor.requireString(RecipientTable.E164)?.e164ToLong())
.blocked(cursor.requireBoolean(RecipientTable.BLOCKED))
.blockedTimestamp(cursor.requireLong(RecipientTable.BLOCKED_AT))
.blockedAtTimestamp(cursor.requireLong(RecipientTable.BLOCKED_AT))
.visibility(Recipient.HiddenState.deserialize(cursor.requireInt(RecipientTable.HIDDEN)).toRemote())
.profileKey(cursor.requireString(RecipientTable.PROFILE_KEY)?.let { ProfileKeyUtil.profileKeyOrNull(it)?.serialize()?.toByteString() })
.profileSharing(cursor.requireBoolean(RecipientTable.PROFILE_SHARING))
@@ -59,7 +59,7 @@ class GroupArchiveExporter(private val selfAci: ServiceId.ACI, private val curso
masterKey = cursor.requireNonNullBlob(GroupTable.V2_MASTER_KEY).toByteString(),
whitelisted = cursor.requireBoolean(RecipientTable.PROFILE_SHARING),
blocked = cursor.requireBoolean(RecipientTable.BLOCKED),
blockedTimestamp = cursor.requireLong(RecipientTable.BLOCKED_AT),
blockedAtTimestamp = cursor.requireLong(RecipientTable.BLOCKED_AT),
hideStory = extras?.hideStory() ?: false,
storySendMode = showAsStoryState.toRemote(),
snapshot = decryptedGroup?.toRemote(isMember, selfAci) ?: Group.GroupSnapshot(),
@@ -51,7 +51,7 @@ object ContactArchiveImporter {
val profileKey = contact.profileKey?.toByteArray()
val values = contentValuesOf(
RecipientTable.BLOCKED to contact.blocked,
RecipientTable.BLOCKED_AT to contact.blockedTimestamp,
RecipientTable.BLOCKED_AT to contact.blockedAtTimestamp,
RecipientTable.HIDDEN to contact.visibility.toLocal().serialize(),
RecipientTable.TYPE to RecipientTable.RecipientType.INDIVIDUAL.id,
RecipientTable.PROFILE_FAMILY_NAME to contact.profileFamilyName,
@@ -57,7 +57,7 @@ object GroupArchiveImporter {
put(RecipientTable.AVATAR_COLOR, AvatarColorHash.forGroupId(groupId).serialize())
put(RecipientTable.PROFILE_SHARING, group.whitelisted.toInt())
put(RecipientTable.BLOCKED, group.blocked.toInt())
put(RecipientTable.BLOCKED_AT, group.blockedTimestamp)
put(RecipientTable.BLOCKED_AT, group.blockedAtTimestamp)
put(RecipientTable.TYPE, RecipientTable.RecipientType.GV2.id)
put(RecipientTable.STORAGE_SERVICE_ID, Base64.encodeWithPadding(StorageSyncHelper.generateKey()))
put(RecipientTable.AVATAR_COLOR, group.avatarColor?.toLocal()?.serialize())
@@ -4447,7 +4447,7 @@ open class RecipientTable(context: Context, databaseHelper: SignalDatabase) : Da
put(USERNAME, if (TextUtils.isEmpty(username)) null else username)
put(PROFILE_SHARING, contact.proto.whitelisted.toInt())
put(BLOCKED, contact.proto.blocked.toInt())
put(BLOCKED_AT, contact.proto.blockedTimestamp)
put(BLOCKED_AT, contact.proto.blockedAtTimestamp)
put(MUTE_UNTIL, contact.proto.mutedUntilTimestamp)
put(STORAGE_SERVICE_ID, Base64.encodeWithPadding(contact.id.raw))
put(HIDDEN, contact.proto.hidden)
@@ -4489,7 +4489,7 @@ open class RecipientTable(context: Context, databaseHelper: SignalDatabase) : Da
put(TYPE, RecipientType.GV2.id)
put(PROFILE_SHARING, if (groupV2.proto.whitelisted) "1" else "0")
put(BLOCKED, if (groupV2.proto.blocked) "1" else "0")
put(BLOCKED_AT, groupV2.proto.blockedTimestamp)
put(BLOCKED_AT, groupV2.proto.blockedAtTimestamp)
put(MUTE_UNTIL, groupV2.proto.mutedUntilTimestamp)
put(STORAGE_SERVICE_ID, Base64.encodeWithPadding(groupV2.id.raw))
put(MENTION_SETTING, if (groupV2.proto.dontNotifyForMentionsIfMuted) NotificationSetting.DO_NOT_NOTIFY.id else NotificationSetting.ALWAYS_NOTIFY.id)
@@ -237,7 +237,7 @@ class ContactRecordProcessor(
identityState = mergedIdentityState
identityKey = mergedIdentityKey?.toByteString() ?: ByteString.EMPTY
blocked = remote.proto.blocked
blockedTimestamp = remote.proto.blockedTimestamp
blockedAtTimestamp = remote.proto.blockedAtTimestamp
whitelisted = remote.proto.whitelisted
archived = remote.proto.archived
markedUnread = remote.proto.markedUnread
@@ -53,7 +53,7 @@ class GroupV2RecordProcessor(private val recipientTable: RecipientTable, private
val merged = SignalGroupV2Record.newBuilder(remote.serializedUnknowns).apply {
masterKey = remote.proto.masterKey
blocked = remote.proto.blocked
blockedTimestamp = remote.proto.blockedTimestamp
blockedAtTimestamp = remote.proto.blockedAtTimestamp
whitelisted = remote.proto.whitelisted
archived = remote.proto.archived
markedUnread = remote.proto.markedUnread
@@ -209,7 +209,7 @@ object StorageSyncModels {
systemFamilyName = recipient.systemProfileName.familyName
systemNickname = recipient.syncExtras.systemNickname ?: ""
blocked = recipient.isBlocked
blockedTimestamp = recipient.blockedAt
blockedAtTimestamp = recipient.blockedAt
whitelisted = recipient.profileSharing || recipient.systemContactUri != null
identityKey = recipient.syncExtras.identityKey?.toByteString() ?: ByteString.EMPTY
identityState = localToRemoteIdentityState(recipient.syncExtras.identityStatus)
@@ -239,7 +239,7 @@ object StorageSyncModels {
return SignalGroupV2Record.newBuilder(recipient.syncExtras.storageProto).apply {
masterKey = groupMasterKey.serialize().toByteString()
blocked = recipient.isBlocked
blockedTimestamp = recipient.blockedAt
blockedAtTimestamp = recipient.blockedAt
whitelisted = recipient.profileSharing
archived = recipient.syncExtras.isArchived
markedUnread = recipient.syncExtras.isForcedUnread
+2 -2
View File
@@ -272,7 +272,7 @@ message Contact {
string systemNickname = 20;
optional AvatarColor avatarColor = 21;
optional bytes keyTransparencyData = 22;
uint64 blockedTimestamp = 23; // if `blocked` is true, 0 means unknown block time
uint64 blockedAtTimestamp = 23; // if `blocked` is true, 0 means unknown block time
}
message Group {
@@ -289,7 +289,7 @@ message Group {
GroupSnapshot snapshot = 5;
bool blocked = 6;
optional AvatarColor avatarColor = 7;
uint64 blockedTimestamp = 8; // if `blocked` is true, 0 means unknown block time
uint64 blockedAtTimestamp = 8; // if `blocked` is true, 0 means unknown block time
// These are simply plaintext copies of the groups proto from Groups.proto.
// They should be kept completely in-sync with Groups.proto.
@@ -143,7 +143,7 @@ message ContactRecord {
optional AvatarColor avatarColor = 24;
bytes aciBinary = 25; // 16-byte UUID
bytes pniBinary = 26; // 16-byte UUID
uint64 blockedTimestamp = 27; // 0 means the blocked time is unknown
uint64 blockedAtTimestamp = 27; // 0 means the blocked time is unknown
// Next ID: 28
}
@@ -175,7 +175,7 @@ message GroupV2Record {
StorySendMode storySendMode = 10;
optional AvatarColor avatarColor = 11;
bytes verifiedNameHash = 12; // SHA-256 of UTF-8 encoded decrypted group title that was last verified
uint64 blockedTimestamp = 13; // 0 means the blocked time is unknown
uint64 blockedAtTimestamp = 13; // 0 means the blocked time is unknown
}
message Payments {