Stop sending isBlocked during contact syncs
This commit is contained in:
parent
3669aa2f93
commit
8d64ca2055
@ -106,8 +106,7 @@ class ContactStreamTest: SignalBaseTest {
|
||||
phoneNumber: E164(signalAccount.recipientPhoneNumber),
|
||||
signalAccount: signalAccount,
|
||||
disappearingMessagesConfiguration: nil,
|
||||
inboxPosition: nil,
|
||||
isBlocked: false
|
||||
inboxPosition: nil
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@ -12,8 +12,7 @@ final class ContactOutputStream: OWSChunkedOutputStream {
|
||||
phoneNumber: E164?,
|
||||
signalAccount: SignalAccount?,
|
||||
disappearingMessagesConfiguration: OWSDisappearingMessagesConfiguration?,
|
||||
inboxPosition: Int?,
|
||||
isBlocked: Bool
|
||||
inboxPosition: Int?
|
||||
) throws {
|
||||
let contactBuilder = SSKProtoContactDetails.builder()
|
||||
if let phoneNumber {
|
||||
@ -50,11 +49,6 @@ final class ContactOutputStream: OWSChunkedOutputStream {
|
||||
contactBuilder.setExpireTimer(disappearingMessagesConfiguration.durationSeconds)
|
||||
}
|
||||
|
||||
// TODO: Stop writing this once all iPads are running at least v6.50.
|
||||
if isBlocked {
|
||||
contactBuilder.setBlocked(true)
|
||||
}
|
||||
|
||||
let contactData: Data
|
||||
do {
|
||||
contactData = try contactBuilder.buildSerializedData()
|
||||
|
||||
@ -12,7 +12,6 @@ import SignalServiceKit
|
||||
enum ContactSyncAttachmentBuilder {
|
||||
static func buildAttachmentFile(
|
||||
for contactSyncMessage: OWSSyncContactsMessage,
|
||||
blockingManager: BlockingManager,
|
||||
contactsManager: OWSContactsManager,
|
||||
tx: SDSAnyReadTransaction
|
||||
) -> URL? {
|
||||
@ -45,7 +44,6 @@ enum ContactSyncAttachmentBuilder {
|
||||
to: ContactOutputStream(outputStream: outputStream),
|
||||
isFullSync: contactSyncMessage.isFullSync,
|
||||
localAddress: localAddress,
|
||||
blockingManager: blockingManager,
|
||||
contactsManager: contactsManager,
|
||||
tx: tx
|
||||
)
|
||||
@ -66,7 +64,6 @@ enum ContactSyncAttachmentBuilder {
|
||||
to contactOutputStream: ContactOutputStream,
|
||||
isFullSync: Bool,
|
||||
localAddress: SignalServiceAddress,
|
||||
blockingManager: BlockingManager,
|
||||
contactsManager: OWSContactsManager,
|
||||
tx: SDSAnyReadTransaction
|
||||
) throws {
|
||||
@ -90,7 +87,6 @@ enum ContactSyncAttachmentBuilder {
|
||||
contactThread: contactThread,
|
||||
signalAccount: signalAccount,
|
||||
inboxPosition: inboxPosition,
|
||||
blockingManager: blockingManager,
|
||||
tx: tx
|
||||
)
|
||||
}
|
||||
@ -108,7 +104,6 @@ enum ContactSyncAttachmentBuilder {
|
||||
contactThread: contactThread,
|
||||
signalAccount: nil,
|
||||
inboxPosition: inboxPosition,
|
||||
blockingManager: blockingManager,
|
||||
tx: tx
|
||||
)
|
||||
}
|
||||
@ -122,20 +117,17 @@ enum ContactSyncAttachmentBuilder {
|
||||
contactThread: TSContactThread?,
|
||||
signalAccount: SignalAccount?,
|
||||
inboxPosition: Int?,
|
||||
blockingManager: BlockingManager,
|
||||
tx: SDSAnyReadTransaction
|
||||
) throws {
|
||||
let dmStore = DependenciesBridge.shared.disappearingMessagesConfigurationStore
|
||||
let dmConfiguration = contactThread.map { dmStore.fetchOrBuildDefault(for: .thread($0), tx: tx.asV2Read) }
|
||||
let isBlocked = blockingManager.isAddressBlocked(address, transaction: tx)
|
||||
|
||||
try contactOutputStream.writeContact(
|
||||
aci: address.serviceId as? Aci,
|
||||
phoneNumber: address.e164,
|
||||
signalAccount: signalAccount,
|
||||
disappearingMessagesConfiguration: dmConfiguration,
|
||||
inboxPosition: inboxPosition,
|
||||
isBlocked: isBlocked
|
||||
inboxPosition: inboxPosition
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@ -436,7 +436,6 @@ extension OWSSyncManager: SyncManagerProtocol, SyncManagerProtocolSwift {
|
||||
let message = OWSSyncContactsMessage(thread: thread, isFullSync: true, tx: tx)
|
||||
guard let syncFileUrl = ContactSyncAttachmentBuilder.buildAttachmentFile(
|
||||
for: message,
|
||||
blockingManager: Self.blockingManager,
|
||||
contactsManager: Self.contactsManagerImpl,
|
||||
tx: tx
|
||||
) else {
|
||||
|
||||
@ -713,7 +713,7 @@ message ContactDetails {
|
||||
reserved /* color */ 4;
|
||||
reserved /* verified */ 5;
|
||||
reserved /* profileKey */ 6;
|
||||
optional bool blocked = 7;
|
||||
reserved /* blocked */ 7;
|
||||
optional uint32 expireTimer = 8;
|
||||
optional uint32 inboxPosition = 10;
|
||||
reserved /* archived */ 11;
|
||||
|
||||
@ -14742,15 +14742,6 @@ public class SSKProtoContactDetails: NSObject, Codable, NSSecureCoding {
|
||||
return proto.hasName
|
||||
}
|
||||
|
||||
@objc
|
||||
public var blocked: Bool {
|
||||
return proto.blocked
|
||||
}
|
||||
@objc
|
||||
public var hasBlocked: Bool {
|
||||
return proto.hasBlocked
|
||||
}
|
||||
|
||||
@objc
|
||||
public var expireTimer: UInt32 {
|
||||
return proto.expireTimer
|
||||
@ -14862,9 +14853,6 @@ extension SSKProtoContactDetails {
|
||||
if let _value = avatar {
|
||||
builder.setAvatar(_value)
|
||||
}
|
||||
if hasBlocked {
|
||||
builder.setBlocked(blocked)
|
||||
}
|
||||
if hasExpireTimer {
|
||||
builder.setExpireTimer(expireTimer)
|
||||
}
|
||||
@ -14938,11 +14926,6 @@ public class SSKProtoContactDetailsBuilder: NSObject {
|
||||
proto.avatar = valueParam.proto
|
||||
}
|
||||
|
||||
@objc
|
||||
public func setBlocked(_ valueParam: Bool) {
|
||||
proto.blocked = valueParam
|
||||
}
|
||||
|
||||
@objc
|
||||
public func setExpireTimer(_ valueParam: UInt32) {
|
||||
proto.expireTimer = valueParam
|
||||
|
||||
@ -4031,15 +4031,6 @@ struct SignalServiceProtos_ContactDetails {
|
||||
/// Clears the value of `avatar`. Subsequent reads from it will return its default value.
|
||||
mutating func clearAvatar() {self._avatar = nil}
|
||||
|
||||
var blocked: Bool {
|
||||
get {return _blocked ?? false}
|
||||
set {_blocked = newValue}
|
||||
}
|
||||
/// Returns true if `blocked` has been explicitly set.
|
||||
var hasBlocked: Bool {return self._blocked != nil}
|
||||
/// Clears the value of `blocked`. Subsequent reads from it will return its default value.
|
||||
mutating func clearBlocked() {self._blocked = nil}
|
||||
|
||||
var expireTimer: UInt32 {
|
||||
get {return _expireTimer ?? 0}
|
||||
set {_expireTimer = newValue}
|
||||
@ -4097,7 +4088,6 @@ struct SignalServiceProtos_ContactDetails {
|
||||
fileprivate var _aci: String? = nil
|
||||
fileprivate var _name: String? = nil
|
||||
fileprivate var _avatar: SignalServiceProtos_ContactDetails.Avatar? = nil
|
||||
fileprivate var _blocked: Bool? = nil
|
||||
fileprivate var _expireTimer: UInt32? = nil
|
||||
fileprivate var _inboxPosition: UInt32? = nil
|
||||
}
|
||||
@ -8496,7 +8486,6 @@ extension SignalServiceProtos_ContactDetails: SwiftProtobuf.Message, SwiftProtob
|
||||
9: .same(proto: "aci"),
|
||||
2: .same(proto: "name"),
|
||||
3: .same(proto: "avatar"),
|
||||
7: .same(proto: "blocked"),
|
||||
8: .same(proto: "expireTimer"),
|
||||
10: .same(proto: "inboxPosition"),
|
||||
]
|
||||
@ -8510,7 +8499,6 @@ extension SignalServiceProtos_ContactDetails: SwiftProtobuf.Message, SwiftProtob
|
||||
case 1: try { try decoder.decodeSingularStringField(value: &self._contactE164) }()
|
||||
case 2: try { try decoder.decodeSingularStringField(value: &self._name) }()
|
||||
case 3: try { try decoder.decodeSingularMessageField(value: &self._avatar) }()
|
||||
case 7: try { try decoder.decodeSingularBoolField(value: &self._blocked) }()
|
||||
case 8: try { try decoder.decodeSingularUInt32Field(value: &self._expireTimer) }()
|
||||
case 9: try { try decoder.decodeSingularStringField(value: &self._aci) }()
|
||||
case 10: try { try decoder.decodeSingularUInt32Field(value: &self._inboxPosition) }()
|
||||
@ -8533,9 +8521,6 @@ extension SignalServiceProtos_ContactDetails: SwiftProtobuf.Message, SwiftProtob
|
||||
try { if let v = self._avatar {
|
||||
try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
|
||||
} }()
|
||||
try { if let v = self._blocked {
|
||||
try visitor.visitSingularBoolField(value: v, fieldNumber: 7)
|
||||
} }()
|
||||
try { if let v = self._expireTimer {
|
||||
try visitor.visitSingularUInt32Field(value: v, fieldNumber: 8)
|
||||
} }()
|
||||
@ -8553,7 +8538,6 @@ extension SignalServiceProtos_ContactDetails: SwiftProtobuf.Message, SwiftProtob
|
||||
if lhs._aci != rhs._aci {return false}
|
||||
if lhs._name != rhs._name {return false}
|
||||
if lhs._avatar != rhs._avatar {return false}
|
||||
if lhs._blocked != rhs._blocked {return false}
|
||||
if lhs._expireTimer != rhs._expireTimer {return false}
|
||||
if lhs._inboxPosition != rhs._inboxPosition {return false}
|
||||
if lhs.unknownFields != rhs.unknownFields {return false}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user