Remove unused NSCopying conformances

This commit is contained in:
Max Radermacher 2026-01-14 16:12:42 -06:00 committed by GitHub
parent 7298ecb44f
commit 6df51b45f4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
90 changed files with 40 additions and 723 deletions

View File

@ -115,17 +115,6 @@ NS_ASSUME_NONNULL_BEGIN
return YES;
}
- (id)copyWithZone:(nullable NSZone *)zone
{
OWSGroupCallMessage *result = [super copyWithZone:zone];
result->_creatorUuid = self.creatorUuid;
result->_eraId = self.eraId;
result->_hasEnded = self.hasEnded;
result->_joinedMemberUuids = self.joinedMemberUuids;
result->_read = self.read;
return result;
}
- (NSArray<AciObjC *> *)joinedMemberAcis
{
NSArray<NSString *> *_Nullable uuids = self.joinedMemberUuids;

View File

@ -37,12 +37,6 @@ public final class OutgoingGroupCallUpdateMessage: TSOutgoingMessage {
return true
}
override public func copy(with zone: NSZone? = nil) -> Any {
let result = super.copy(with: zone) as! Self
result.eraId = self.eraId
return result
}
/// The era ID of the call with the update.
private(set) var eraId: String?

View File

@ -149,15 +149,6 @@ NSString *NSStringFromCallType(RPRecentCallType callType)
return YES;
}
- (id)copyWithZone:(nullable NSZone *)zone
{
TSCall *result = [super copyWithZone:zone];
result->_callType = self.callType;
result->_offerType = self.offerType;
result->_read = self.read;
return result;
}
- (OWSInteractionType)interactionType
{
return OWSInteractionType_Call;

View File

@ -132,12 +132,6 @@ public class OutgoingCallEventSyncMessage: OWSOutgoingSyncMessage {
return true
}
override public func copy(with zone: NSZone? = nil) -> Any {
let result = super.copy(with: zone) as! Self
result.callEvent = self.callEvent
return result
}
/// The call event.
private(set) var callEvent: OutgoingCallEvent!

View File

@ -42,13 +42,6 @@ public class OutgoingCallLinkUpdateMessage: OWSOutgoingSyncMessage {
return true
}
override public func copy(with zone: NSZone? = nil) -> Any {
let result = super.copy(with: zone) as! Self
result.adminPasskey = self.adminPasskey
result.rootKey = self.rootKey
return result
}
private var rootKey: Data!
private var adminPasskey: Data?

View File

@ -37,12 +37,6 @@ public class OutgoingCallLogEventSyncMessage: OWSOutgoingSyncMessage {
return true
}
override public func copy(with zone: NSZone? = nil) -> Any {
let result = super.copy(with: zone) as! Self
result.callLogEvent = self.callLogEvent
return result
}
/// The call log event.
private(set) var callLogEvent: CallLogEvent!

View File

@ -68,13 +68,6 @@ public final class OutgoingCallMessage: TSOutgoingMessage {
return true
}
override public func copy(with zone: NSZone? = nil) -> Any {
let result = super.copy(with: zone) as! Self
result.messageType = self.messageType
result.destinationDeviceId = self.destinationDeviceId
return result
}
override public func shouldSyncTranscript() -> Bool { false }
override public func contentBuilder(thread: TSThread, transaction: DBReadTransaction) -> SSKProtoContentBuilder? {

View File

@ -142,6 +142,9 @@ NS_ASSUME_NONNULL_BEGIN
- (instancetype)copyWithIsEnabled:(BOOL)isEnabled timerVersion:(uint32_t)timerVersion
{
// for compiler enforcement
id<NSCopying> selfToCopy = self;
(void)selfToCopy;
OWSDisappearingMessagesConfiguration *newInstance = [self copy];
newInstance.enabled = isEnabled;
newInstance.timerVersion = timerVersion;
@ -153,6 +156,9 @@ NS_ASSUME_NONNULL_BEGIN
- (instancetype)copyWithDurationSeconds:(uint32_t)durationSeconds timerVersion:(uint32_t)timerVersion
{
// for compiler enforcement
id<NSCopying> selfToCopy = self;
(void)selfToCopy;
OWSDisappearingMessagesConfiguration *newInstance = [self copy];
newInstance.durationSeconds = durationSeconds;
newInstance.timerVersion = timerVersion;
@ -161,6 +167,9 @@ NS_ASSUME_NONNULL_BEGIN
- (instancetype)copyAsEnabledWithDurationSeconds:(uint32_t)durationSeconds timerVersion:(uint32_t)timerVersion
{
// for compiler enforcement
id<NSCopying> selfToCopy = self;
(void)selfToCopy;
OWSDisappearingMessagesConfiguration *newInstance = [self copy];
newInstance.enabled = YES;
newInstance.durationSeconds = durationSeconds;

View File

@ -334,24 +334,3 @@ private extension String {
return filtered.nilIfEmpty
}
}
// MARK: - NSCopying
extension SignalAccount: NSCopying {
public func copy(with zone: NSZone? = nil) -> Any {
return SignalAccount(
id: self.id,
uniqueId: self.uniqueId,
contactAvatarHash: self.contactAvatarHash,
multipleAccountLabelText: self.multipleAccountLabelText,
recipientPhoneNumber: self.recipientPhoneNumber,
recipientServiceId: self.recipientServiceId,
hasDeprecatedRepresentation: self.hasDeprecatedRepresentation,
cnContactId: self.cnContactId,
givenName: self.givenName,
familyName: self.familyName,
nickname: self.nickname,
fullName: self.fullName,
)
}
}

View File

@ -33,7 +33,7 @@ typedef NS_CLOSED_ENUM(NSUInteger, TSThreadStoryViewMode) {
/**
* TSThread is the superclass of TSContactThread, TSGroupThread, and TSPrivateStoryThread
*/
@interface TSThread : BaseModel <NSCopying>
@interface TSThread : BaseModel
@property (nonatomic) TSThreadStoryViewMode storyViewMode;
@property (nonatomic, nullable) NSNumber *lastSentStoryTimestamp;

View File

@ -207,34 +207,6 @@ lastVisibleSortIdOnScreenPercentageObsolete:(double)lastVisibleSortIdOnScreenPer
return YES;
}
- (id)copyWithZone:(nullable NSZone *)zone
{
TSThread *result = [self copyAndAssignIdsWithZone:zone];
result->_conversationColorNameObsolete = self.conversationColorNameObsolete;
result->_creationDate = self.creationDate;
result->_editTargetTimestamp = self.editTargetTimestamp;
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
result->_isArchivedByLegacyTimestampForSorting = self.isArchivedByLegacyTimestampForSorting;
#pragma clang diagnostic pop
result->_isArchivedObsolete = self.isArchivedObsolete;
result->_isMarkedUnreadObsolete = self.isMarkedUnreadObsolete;
result->_lastDraftInteractionRowId = self.lastDraftInteractionRowId;
result->_lastDraftUpdateTimestamp = self.lastDraftUpdateTimestamp;
result->_lastInteractionRowId = self.lastInteractionRowId;
result->_lastSentStoryTimestamp = self.lastSentStoryTimestamp;
result->_lastVisibleSortIdObsolete = self.lastVisibleSortIdObsolete;
result->_lastVisibleSortIdOnScreenPercentageObsolete = self.lastVisibleSortIdOnScreenPercentageObsolete;
result->_mentionNotificationMode = self.mentionNotificationMode;
result->_messageDraft = [self.messageDraft copy];
result->_messageDraftBodyRanges = self.messageDraftBodyRanges;
result->_mutedUntilDateObsolete = self.mutedUntilDateObsolete;
result->_mutedUntilTimestampObsolete = self.mutedUntilTimestampObsolete;
result->_shouldThreadBeVisible = self.shouldThreadBeVisible;
result->_storyViewMode = self.storyViewMode;
return result;
}
- (void)anyDidInsertWithTransaction:(DBWriteTransaction *)transaction
{
[super anyDidInsertWithTransaction:transaction];

View File

@ -57,7 +57,7 @@ class MockUserProfileStore: UserProfileStore {
func updateUserProfile(_ userProfile: OWSUserProfile, tx: DBWriteTransaction) {
let index = userProfiles.firstIndex(where: { $0.uniqueId == userProfile.uniqueId })!
userProfiles[index] = userProfile.copy() as! OWSUserProfile
userProfiles[index] = userProfile.shallowCopy()
}
func removeUserProfile(_ userProfile: OWSUserProfile, tx: DBWriteTransaction) {

View File

@ -82,15 +82,6 @@ NS_ASSUME_NONNULL_BEGIN
return YES;
}
- (id)copyWithZone:(nullable NSZone *)zone
{
OWSBlockedPhoneNumbersMessage *result = [super copyWithZone:zone];
result->_groupIds = self.groupIds;
result->_phoneNumbers = self.phoneNumbers;
result->_uuids = self.uuids;
return result;
}
- (instancetype)initWithLocalThread:(TSContactThread *)localThread
phoneNumbers:(NSArray<NSString *> *)phoneNumbers
aciStrings:(NSArray<NSString *> *)aciStrings

View File

@ -11,7 +11,7 @@ NS_ASSUME_NONNULL_BEGIN
@class DBReadTransaction;
@class SignalServiceAddress;
@interface OWSLinkedDeviceReadReceipt : NSObject <NSSecureCoding, NSCopying>
@interface OWSLinkedDeviceReadReceipt : NSObject <NSSecureCoding>
@property (nonatomic, readonly) SignalServiceAddress *senderAddress;
@property (nonatomic, readonly, nullable) NSString *messageUniqueId; // Only nil if decoding old values

View File

@ -149,18 +149,6 @@ NSUInteger const OWSLinkedDeviceReadReceiptSchemaVersion = 1;
return YES;
}
- (id)copyWithZone:(nullable NSZone *)zone
{
OWSLinkedDeviceReadReceipt *result = [[[self class] allocWithZone:zone] init];
result->_linkedDeviceReadReceiptSchemaVersion = self.linkedDeviceReadReceiptSchemaVersion;
result->_messageIdTimestamp = self.messageIdTimestamp;
result->_messageUniqueId = self.messageUniqueId;
result->_readTimestamp = self.readTimestamp;
result->_senderPhoneNumber = self.senderPhoneNumber;
result->_senderUUID = self.senderUUID;
return result;
}
- (SignalServiceAddress *)senderAddress
{
return [SignalServiceAddress legacyAddressWithServiceIdString:self.senderUUID phoneNumber:self.senderPhoneNumber];

View File

@ -76,13 +76,6 @@ NS_ASSUME_NONNULL_BEGIN
return YES;
}
- (id)copyWithZone:(nullable NSZone *)zone
{
OWSReadReceiptsForLinkedDevicesMessage *result = [super copyWithZone:zone];
result->_readReceipts = self.readReceipts;
return result;
}
- (nullable SSKProtoSyncMessageBuilder *)syncMessageBuilderWithTransaction:(DBReadTransaction *)transaction
{
SSKProtoSyncMessageBuilder *syncMessageBuilder = [SSKProtoSyncMessage builder];

View File

@ -126,16 +126,6 @@ NS_ASSUME_NONNULL_BEGIN
return YES;
}
- (id)copyWithZone:(nullable NSZone *)zone
{
OWSVerificationStateSyncMessage *result = [super copyWithZone:zone];
result->_identityKey = self.identityKey;
result->_paddingBytesLength = self.paddingBytesLength;
result->_verificationForRecipientAddress = self.verificationForRecipientAddress;
result->_verificationState = self.verificationState;
return result;
}
- (nullable SSKProtoSyncMessageBuilder *)syncMessageBuilderWithTransaction:(DBReadTransaction *)transaction
{
// We add the same amount of padding in the VerificationStateSync message and it's corresponding NullMessage so that

View File

@ -108,16 +108,6 @@ NS_ASSUME_NONNULL_BEGIN
return YES;
}
- (id)copyWithZone:(nullable NSZone *)zone
{
OWSViewOnceMessageReadSyncMessage *result = [super copyWithZone:zone];
result->_messageIdTimestamp = self.messageIdTimestamp;
result->_messageUniqueId = self.messageUniqueId;
result->_readTimestamp = self.readTimestamp;
result->_senderAddress = self.senderAddress;
return result;
}
- (BOOL)isUrgent
{
return NO;

View File

@ -13,7 +13,7 @@ NS_ASSUME_NONNULL_BEGIN
@class DBReadTransaction;
@class SignalServiceAddress;
@interface OWSLinkedDeviceViewedReceipt : NSObject <NSSecureCoding, NSCopying>
@interface OWSLinkedDeviceViewedReceipt : NSObject <NSSecureCoding>
@property (nonatomic, readonly) SignalServiceAddress *senderAddress;
@property (nonatomic, readonly, nullable) NSString *messageUniqueId; // Only nil if decoding old values

View File

@ -76,13 +76,6 @@ NS_ASSUME_NONNULL_BEGIN
return YES;
}
- (id)copyWithZone:(nullable NSZone *)zone
{
OWSViewedReceiptsForLinkedDevicesMessage *result = [super copyWithZone:zone];
result->_viewedReceipts = self.viewedReceipts;
return result;
}
- (BOOL)isUrgent
{
return NO;
@ -235,17 +228,6 @@ NS_ASSUME_NONNULL_BEGIN
return YES;
}
- (id)copyWithZone:(nullable NSZone *)zone
{
OWSLinkedDeviceViewedReceipt *result = [[[self class] allocWithZone:zone] init];
result->_messageIdTimestamp = self.messageIdTimestamp;
result->_messageUniqueId = self.messageUniqueId;
result->_senderPhoneNumber = self.senderPhoneNumber;
result->_senderUUID = self.senderUUID;
result->_viewedTimestamp = self.viewedTimestamp;
return result;
}
- (SignalServiceAddress *)senderAddress
{
return [SignalServiceAddress legacyAddressWithServiceIdString:self.senderUUID phoneNumber:self.senderPhoneNumber];

View File

@ -35,12 +35,6 @@ public class OutgoingDeviceNameChangeSyncMessage: OWSOutgoingSyncMessage {
return true
}
override public func copy(with zone: NSZone? = nil) -> Any {
let result = super.copy(with: zone) as! Self
result.deviceId = self.deviceId
return result
}
private(set) var deviceId: NSNumber!
init(

View File

@ -53,13 +53,6 @@ final class StickerPackSyncMessage: OWSOutgoingSyncMessage {
return true
}
override func copy(with zone: NSZone? = nil) -> Any {
let result = super.copy(with: zone) as! Self
result.operationType = self.operationType
result.packs = self.packs
return result
}
init(
localThread: TSContactThread,
packs: [StickerPackInfo],

View File

@ -65,7 +65,7 @@ public enum GroupV2Access: UInt, Codable, CustomStringConvertible {
// This class is immutable.
@objc
public final class GroupAccess: NSObject, NSSecureCoding, NSCopying {
public final class GroupAccess: NSObject, NSSecureCoding {
public static var supportsSecureCoding: Bool { true }
public init?(coder: NSCoder) {
@ -97,10 +97,6 @@ public final class GroupAccess: NSObject, NSSecureCoding, NSCopying {
return true
}
public func copy(with zone: NSZone? = nil) -> Any {
return self
}
public let members: GroupV2Access
public let attributes: GroupV2Access
public let addFromInviteLink: GroupV2Access

View File

@ -884,7 +884,7 @@ public class GroupMembership: NSObject, NSSecureCoding {
// MARK: - InvalidInviteModel
@objc(GroupMembershipInvalidInviteModel)
private final class InvalidInviteModel: NSObject, NSSecureCoding, NSCopying {
private final class InvalidInviteModel: NSObject, NSSecureCoding {
static var supportsSecureCoding: Bool { true }
init?(coder: NSCoder) {
@ -916,10 +916,6 @@ private final class InvalidInviteModel: NSObject, NSSecureCoding, NSCopying {
return true
}
func copy(with zone: NSZone? = nil) -> Any {
return self
}
let userId: Data?
let addedByUserId: Data?
@ -932,7 +928,7 @@ private final class InvalidInviteModel: NSObject, NSSecureCoding, NSCopying {
// MARK: - LegacyMemberState
@objc(_TtCC16SignalServiceKit15GroupMembership11MemberState)
private final class LegacyMemberState: NSObject, NSSecureCoding, NSCopying {
private final class LegacyMemberState: NSObject, NSSecureCoding {
static var supportsSecureCoding: Bool { true }
init?(coder: NSCoder) {
@ -966,10 +962,6 @@ private final class LegacyMemberState: NSObject, NSSecureCoding, NSCopying {
return true
}
func copy(with zone: NSZone? = nil) -> Any {
return self
}
let role: TSGroupMemberRole
let isPending: Bool
// Only applies for pending members.

View File

@ -9,7 +9,7 @@ public import LibSignalClient
/// MessageBody is a container for a message's body as well as the `MessageBodyRanges` that
/// apply to it.
/// Most of the work is done by `MessageBodyRanges`; this is just a container for the text too.
public class MessageBody: NSObject, NSCopying, NSSecureCoding {
public class MessageBody: NSObject, NSSecureCoding {
typealias Style = MessageBodyRanges.Style
typealias CollapsedStyle = MessageBodyRanges.CollapsedStyle
@ -58,10 +58,6 @@ public class MessageBody: NSObject, NSCopying, NSSecureCoding {
self.ranges = ranges
}
public func copy(with zone: NSZone? = nil) -> Any {
return MessageBody(text: text, ranges: ranges)
}
public func encode(with coder: NSCoder) {
coder.encode(text, forKey: "text")
coder.encode(ranges, forKey: "ranges")

View File

@ -39,12 +39,6 @@ class DeleteForMeOutgoingSyncMessage: OWSOutgoingSyncMessage {
return true
}
override func copy(with zone: NSZone? = nil) -> Any {
let result = super.copy(with: zone) as! Self
result.contents = self.contents
return result
}
typealias Outgoing = DeleteForMeSyncMessage.Outgoing
struct Contents: Codable {

View File

@ -113,17 +113,6 @@ NS_ASSUME_NONNULL_BEGIN
return YES;
}
- (id)copyWithZone:(nullable NSZone *)zone
{
OWSSyncConfigurationMessage *result = [super copyWithZone:zone];
result->_areReadReceiptsEnabled = self.areReadReceiptsEnabled;
result->_provisioningVersion = self.provisioningVersion;
result->_sendLinkPreviews = self.sendLinkPreviews;
result->_showTypingIndicators = self.showTypingIndicators;
result->_showUnidentifiedDeliveryIndicators = self.showUnidentifiedDeliveryIndicators;
return result;
}
- (nullable SSKProtoSyncMessageBuilder *)syncMessageBuilderWithTransaction:(DBReadTransaction *)transaction
{
SSKProtoSyncMessageConfigurationBuilder *configurationBuilder = [SSKProtoSyncMessageConfiguration builder];

View File

@ -69,13 +69,6 @@ NS_ASSUME_NONNULL_BEGIN
return YES;
}
- (id)copyWithZone:(nullable NSZone *)zone
{
OWSSyncFetchLatestMessage *result = [super copyWithZone:zone];
result->_fetchType = self.fetchType;
return result;
}
- (SSKProtoSyncMessageFetchLatestType)protoFetchType
{
switch (self.fetchType) {

View File

@ -97,15 +97,6 @@ NS_ASSUME_NONNULL_BEGIN
return YES;
}
- (id)copyWithZone:(nullable NSZone *)zone
{
OWSSyncKeysMessage *result = [super copyWithZone:zone];
result->_accountEntropyPool = self.accountEntropyPool;
result->_masterKey = self.masterKey;
result->_mediaRootBackupKey = self.mediaRootBackupKey;
return result;
}
- (nullable SSKProtoSyncMessageBuilder *)syncMessageBuilderWithTransaction:(DBReadTransaction *)transaction
{
SSKProtoSyncMessageKeysBuilder *keysBuilder = [SSKProtoSyncMessageKeys builder];

View File

@ -90,16 +90,6 @@ NS_ASSUME_NONNULL_BEGIN
return YES;
}
- (id)copyWithZone:(nullable NSZone *)zone
{
OWSSyncMessageRequestResponseMessage *result = [super copyWithZone:zone];
result->_groupId = self.groupId;
result->_responseType = self.responseType;
result->_threadAci = self.threadAci;
result->_version = self.version;
return result;
}
- (instancetype)initWithLocalThread:(TSContactThread *)localThread
messageRequestThread:(TSThread *)thread
responseType:(OWSSyncMessageRequestResponseType)responseType

View File

@ -75,13 +75,6 @@ NS_ASSUME_NONNULL_BEGIN
return YES;
}
- (id)copyWithZone:(nullable NSZone *)zone
{
OWSSyncRequestMessage *result = [super copyWithZone:zone];
result->_requestType = self.requestType;
return result;
}
- (nullable SSKProtoSyncMessageBuilder *)syncMessageBuilderWithTransaction:(DBReadTransaction *)transaction
{
SSKProtoSyncMessageRequestBuilder *requestBuilder = [SSKProtoSyncMessageRequest builder];

View File

@ -11,7 +11,7 @@ NS_ASSUME_NONNULL_BEGIN
@class AciObjC;
@interface OutgoingPaymentMobileCoin : NSObject <NSSecureCoding, NSCopying>
@interface OutgoingPaymentMobileCoin : NSObject <NSSecureCoding>
@property (nonatomic, readonly, nullable) AciObjC *recipientAci;
@property (nonatomic, readonly, nullable) NSData *recipientAddress;

View File

@ -170,23 +170,6 @@ NS_ASSUME_NONNULL_BEGIN
return YES;
}
- (id)copyWithZone:(nullable NSZone *)zone
{
OutgoingPaymentMobileCoin *result = [[[self class] allocWithZone:zone] init];
result->_amountPicoMob = self.amountPicoMob;
result->_blockIndex = self.blockIndex;
result->_blockTimestamp = self.blockTimestamp;
result->_feePicoMob = self.feePicoMob;
result->_isDefragmentation = self.isDefragmentation;
result->_memoMessage = self.memoMessage;
result->_outputPublicKeys = self.outputPublicKeys;
result->_receiptData = self.receiptData;
result->_recipientAddress = self.recipientAddress;
result->_recipientUuidString = self.recipientUuidString;
result->_spentKeyImages = self.spentKeyImages;
return result;
}
- (nullable AciObjC *)recipientAci
{
return [[AciObjC alloc] initWithAciString:self.recipientUuidString];
@ -263,13 +246,6 @@ NS_ASSUME_NONNULL_BEGIN
return YES;
}
- (id)copyWithZone:(nullable NSZone *)zone
{
OutgoingPaymentSyncMessage *result = [super copyWithZone:zone];
result->_mobileCoin = self.mobileCoin;
return result;
}
- (nullable SSKProtoSyncMessageBuilder *)syncMessageBuilderWithTransaction:(DBReadTransaction *)transaction
{
return [self syncMessageBuilderWithMobileCoin:self.mobileCoin transaction:transaction];

View File

@ -62,15 +62,6 @@ class OutgoingSentMessageTranscript: OWSOutgoingSyncMessage {
return true
}
override func copy(with zone: NSZone? = nil) -> Any {
let result = super.copy(with: zone) as! Self
result.isRecipientUpdate = self.isRecipientUpdate
result.message = self.message
result.messageThread = self.messageThread
result.sentRecipientAddress = self.sentRecipientAddress
return result
}
override var isUrgent: Bool { false }
override func syncMessageBuilder(transaction: DBReadTransaction) -> SSKProtoSyncMessageBuilder? {

View File

@ -40,13 +40,6 @@ public final class OutgoingEditMessage: TSOutgoingMessage {
return true
}
override public func copy(with zone: NSZone? = nil) -> Any {
let result = super.copy(with: zone) as! Self
result.editedMessage = self.editedMessage
result.targetMessageTimestamp = self.targetMessageTimestamp
return result
}
// MARK: - Edit target data
@objc

View File

@ -6,7 +6,7 @@
public import Contacts
@objc(OWSContactAddress)
public final class OWSContactAddress: NSObject, NSSecureCoding, NSCopying, OWSContactField {
public final class OWSContactAddress: NSObject, NSSecureCoding, OWSContactField {
public static var supportsSecureCoding: Bool { true }
public init?(coder: NSCoder) {
@ -78,10 +78,6 @@ public final class OWSContactAddress: NSObject, NSSecureCoding, NSCopying, OWSCo
return true
}
public func copy(with zone: NSZone? = nil) -> Any {
return self
}
@objc(OWSContactAddressType)
public enum `Type`: Int, CustomStringConvertible {
case home = 1

View File

@ -6,7 +6,7 @@
public import Contacts
@objc(OWSContactEmail)
public final class OWSContactEmail: NSObject, NSSecureCoding, NSCopying, OWSContactField {
public final class OWSContactEmail: NSObject, NSSecureCoding, OWSContactField {
public static var supportsSecureCoding: Bool { true }
public init?(coder: NSCoder) {
@ -40,10 +40,6 @@ public final class OWSContactEmail: NSObject, NSSecureCoding, NSCopying, OWSCont
return true
}
public func copy(with zone: NSZone? = nil) -> Any {
return self
}
@objc(OWSContactEmailType)
public enum `Type`: Int, CustomStringConvertible {
case home = 1

View File

@ -6,7 +6,7 @@
public import Contacts
@objc(OWSContactName)
public final class OWSContactName: NSObject, NSSecureCoding, NSCopying {
public final class OWSContactName: NSObject, NSSecureCoding {
public static var supportsSecureCoding: Bool { true }
public init?(coder: NSCoder) {
@ -68,18 +68,6 @@ public final class OWSContactName: NSObject, NSSecureCoding, NSCopying {
return true
}
public func copy(with zone: NSZone? = nil) -> Any {
return Self(
givenName: givenName,
familyName: familyName,
namePrefix: namePrefix,
nameSuffix: nameSuffix,
middleName: middleName,
nickname: nickname,
organizationName: organizationName,
)
}
public let givenName: String?
public let familyName: String?
public let namePrefix: String?

View File

@ -6,7 +6,7 @@
public import Contacts
@objc(OWSContactPhoneNumber)
public final class OWSContactPhoneNumber: NSObject, NSSecureCoding, NSCopying, OWSContactField {
public final class OWSContactPhoneNumber: NSObject, NSSecureCoding, OWSContactField {
public static var supportsSecureCoding: Bool { true }
public init?(coder: NSCoder) {
@ -40,10 +40,6 @@ public final class OWSContactPhoneNumber: NSObject, NSSecureCoding, NSCopying, O
return true
}
public func copy(with zone: NSZone? = nil) -> Any {
return self
}
@objc(OWSContactPhoneType)
public enum `Type`: Int, CustomStringConvertible {
case home = 1

View File

@ -55,16 +55,6 @@ NS_ASSUME_NONNULL_BEGIN
return YES;
}
- (id)copyWithZone:(nullable NSZone *)zone
{
OWSDisappearingConfigurationUpdateInfoMessage *result = [super copyWithZone:zone];
result->_configurationDurationSeconds = self.configurationDurationSeconds;
result->_configurationIsEnabled = self.configurationIsEnabled;
result->_createdByRemoteName = self.createdByRemoteName;
result->_createdInExistingGroup = self.createdInExistingGroup;
return result;
}
- (instancetype)initWithContactThread:(TSContactThread *)contactThread
timestamp:(uint64_t)timestamp
isConfigurationEnabled:(BOOL)isConfigurationEnabled

View File

@ -92,14 +92,6 @@ NS_ASSUME_NONNULL_BEGIN
return YES;
}
- (id)copyWithZone:(nullable NSZone *)zone
{
OWSDisappearingMessagesConfigurationMessage *result = [super copyWithZone:zone];
result->_configuration = self.configuration;
return result;
}
- (nullable SSKProtoDataMessageBuilder *)dataMessageBuilderWithThread:(TSThread *)thread
transaction:(DBReadTransaction *)transaction
{

View File

@ -81,13 +81,6 @@ NS_ASSUME_NONNULL_BEGIN
return YES;
}
- (id)copyWithZone:(nullable NSZone *)zone
{
OWSStaticOutgoingMessage *result = [super copyWithZone:zone];
result->_plaintextData = self.plaintextData;
return result;
}
- (BOOL)shouldBeSaved
{
return NO;

View File

@ -64,15 +64,6 @@ NS_ASSUME_NONNULL_BEGIN
return YES;
}
- (id)copyWithZone:(nullable NSZone *)zone
{
OWSVerificationStateChangeMessage *result = [super copyWithZone:zone];
result->_isLocalChange = self.isLocalChange;
result->_recipientAddress = self.recipientAddress;
result->_verificationState = self.verificationState;
return result;
}
- (bool)isVerified
{
return _verificationState == OWSVerificationStateVerified;

View File

@ -47,15 +47,6 @@ public class OutgoingPinMessage: TSOutgoingMessage {
return true
}
override public func copy(with zone: NSZone? = nil) -> Any {
let result = super.copy(with: zone) as! Self
result.pinDurationForever = self.pinDurationForever
result.pinDurationSeconds = self.pinDurationSeconds
result.targetMessageAuthorAciBinary = self.targetMessageAuthorAciBinary
result.targetMessageTimestamp = self.targetMessageTimestamp
return result
}
public private(set) var targetMessageTimestamp: UInt64 = 0
public private(set) var targetMessageAuthorAciBinary: Data?
public private(set) var pinDurationSeconds: UInt32 = 0

View File

@ -39,13 +39,6 @@ public class OutgoingUnpinMessage: TSOutgoingMessage {
return true
}
override public func copy(with zone: NSZone? = nil) -> Any {
let result = super.copy(with: zone) as! Self
result.targetMessageAuthorAciBinary = self.targetMessageAuthorAciBinary
result.targetMessageTimestamp = self.targetMessageTimestamp
return result
}
public private(set) var targetMessageTimestamp: UInt64 = 0
public private(set) var targetMessageAuthorAciBinary: Data?

View File

@ -32,12 +32,6 @@ class OutgoingPollTerminateMessage: TSOutgoingMessage {
return true
}
override func copy(with zone: NSZone? = nil) -> Any {
let result = super.copy(with: zone) as! Self
result.targetPollTimestamp = self.targetPollTimestamp
return result
}
var targetPollTimestamp: UInt64 = 0
init(

View File

@ -49,15 +49,6 @@ public class OutgoingPollVoteMessage: TSOutgoingMessage {
return true
}
override public func copy(with zone: NSZone? = nil) -> Any {
let result = super.copy(with: zone) as! Self
result.targetPollAuthorAciBinary = self.targetPollAuthorAciBinary
result.targetPollTimestamp = self.targetPollTimestamp
result.voteCount = self.voteCount
result.voteOptionIndexes = self.voteOptionIndexes
return result
}
var targetPollTimestamp: UInt64 = 0
var targetPollAuthorAciBinary: Data?
var voteOptionIndexes: [UInt32]?

View File

@ -30,7 +30,7 @@ typedef NS_ENUM(NSUInteger, TSQuotedMessageContentSource) {
TSQuotedMessageContentSourceStory
};
@interface OWSAttachmentInfo : NSObject <NSSecureCoding, NSCopying>
@interface OWSAttachmentInfo : NSObject <NSSecureCoding>
@property (class, nonatomic, readonly) NSUInteger currentSchemaVersion;
@property (nonatomic, readonly, nullable) NSString *attachmentId;

View File

@ -119,15 +119,6 @@ NS_ASSUME_NONNULL_BEGIN
return YES;
}
- (id)copyWithZone:(nullable NSZone *)zone
{
OWSAttachmentInfo *result = [[[self class] allocWithZone:zone] init];
result->_attachmentId = self.attachmentId;
result->_contentType = self.contentType;
result->_sourceFilename = self.sourceFilename;
return result;
}
@end
// MARK: -

View File

@ -56,17 +56,6 @@ NS_ASSUME_NONNULL_BEGIN
return YES;
}
- (id)copyWithZone:(nullable NSZone *)zone
{
TSErrorMessage *result = [super copyWithZone:zone];
result->_errorType = self.errorType;
result->_read = self.read;
result->_recipientAddress = self.recipientAddress;
result->_sender = self.sender;
result->_wasIdentityVerified = self.wasIdentityVerified;
return result;
}
- (instancetype)initErrorMessageWithBuilder:(TSErrorMessageBuilder *)errorMessageBuilder
{
self = [super initMessageWithBuilder:errorMessageBuilder];

View File

@ -75,21 +75,6 @@ NS_ASSUME_NONNULL_BEGIN
return YES;
}
- (id)copyWithZone:(nullable NSZone *)zone
{
TSIncomingMessage *result = [super copyWithZone:zone];
result->_authorPhoneNumber = self.authorPhoneNumber;
result->_authorUUID = self.authorUUID;
result->_deprecated_sourceDeviceId = self.deprecated_sourceDeviceId;
result->_read = self.read;
result->_serverDeliveryTimestamp = self.serverDeliveryTimestamp;
result->_serverGuid = self.serverGuid;
result->_serverTimestamp = self.serverTimestamp;
result->_viewed = self.viewed;
result->_wasReceivedByUD = self.wasReceivedByUD;
return result;
}
- (instancetype)initIncomingMessageWithBuilder:(TSIncomingMessageBuilder *)incomingMessageBuilder
{
self = [super initMessageWithBuilder:incomingMessageBuilder];

View File

@ -106,18 +106,6 @@ const InfoMessageUserInfoKey InfoMessageUserInfoKeyPinnedMessage = @"InfoMessage
return YES;
}
- (id)copyWithZone:(nullable NSZone *)zone
{
TSInfoMessage *result = [super copyWithZone:zone];
result->_customMessage = self.customMessage;
result->_infoMessageUserInfo = self.infoMessageUserInfo;
result->_messageType = self.messageType;
result->_read = self.read;
result->_serverGuid = self.serverGuid;
result->_unregisteredAddress = self.unregisteredAddress;
return result;
}
- (instancetype)initWithThread:(TSThread *)thread
timestamp:(uint64_t)timestamp
serverGuid:(nullable NSString *)serverGuid

View File

@ -35,7 +35,7 @@ NSString *NSStringFromOWSInteractionType(OWSInteractionType value);
#pragma mark -
@interface TSInteraction : BaseModel <NSCopying>
@interface TSInteraction : BaseModel
+ (instancetype)new NS_UNAVAILABLE;
- (instancetype)init NS_UNAVAILABLE;

View File

@ -204,16 +204,6 @@ NSString *NSStringFromOWSInteractionType(OWSInteractionType value)
return YES;
}
- (id)copyWithZone:(nullable NSZone *)zone
{
TSInteraction *result = [self copyAndAssignIdsWithZone:zone];
result->_receivedAtTimestamp = self.receivedAtTimestamp;
result->_sortId = self.sortId;
result->_timestamp = self.timestamp;
result->_uniqueThreadId = self.uniqueThreadId;
return result;
}
#pragma mark Thread
- (nullable TSThread *)threadWithTx:(DBReadTransaction *)tx

View File

@ -466,36 +466,6 @@ static const NSUInteger OWSMessageSchemaVersion = 4;
return YES;
}
- (id)copyWithZone:(nullable NSZone *)zone
{
TSMessage *result = [super copyWithZone:zone];
result->_body = self.body;
result->_bodyRanges = self.bodyRanges;
result->_contactShare = self.contactShare;
result->_deprecated_attachmentIds = self.deprecated_attachmentIds;
result->_editState = self.editState;
result->_expireStartedAt = self.expireStartedAt;
result->_expireTimerVersion = self.expireTimerVersion;
result->_expiresAt = self.expiresAt;
result->_expiresInSeconds = self.expiresInSeconds;
result->_giftBadge = self.giftBadge;
result->_isGroupStoryReply = self.isGroupStoryReply;
result->_isPoll = self.isPoll;
result->_isSmsMessageRestoredFromBackup = self.isSmsMessageRestoredFromBackup;
result->_isViewOnceComplete = self.isViewOnceComplete;
result->_isViewOnceMessage = self.isViewOnceMessage;
result->_linkPreview = self.linkPreview;
result->_messageSticker = self.messageSticker;
result->_quotedMessage = self.quotedMessage;
result->_schemaVersion = self.schemaVersion;
result->_storedShouldStartExpireTimer = self.storedShouldStartExpireTimer;
result->_storyAuthorUuidString = self.storyAuthorUuidString;
result->_storyReactionEmoji = self.storyReactionEmoji;
result->_storyTimestamp = self.storyTimestamp;
result->_wasRemotelyDeleted = self.wasRemotelyDeleted;
return result;
}
- (void)setExpireStartedAt:(uint64_t)expireStartedAt
{
if (_expireStartedAt != 0 && _expireStartedAt < expireStartedAt) {

View File

@ -100,15 +100,6 @@ NS_ASSUME_NONNULL_BEGIN
return YES;
}
- (id)copyWithZone:(nullable NSZone *)zone
{
TSOutgoingDeleteMessage *result = [super copyWithZone:zone];
result->_isDeletingStoryMessage = self.isDeletingStoryMessage;
result->_messageTimestamp = self.messageTimestamp;
result->_messageUniqueId = self.messageUniqueId;
return result;
}
- (instancetype)initWithThread:(TSThread *)thread
storyMessage:(StoryMessage *)storyMessage
skippedRecipients:(NSArray<ServiceIdObjC *> *)skippedRecipients

View File

@ -311,25 +311,6 @@ NSUInteger const TSOutgoingMessageSchemaVersion = 1;
return YES;
}
- (id)copyWithZone:(nullable NSZone *)zone
{
TSOutgoingMessage *result = [super copyWithZone:zone];
result->_changeActionsProtoData = self.changeActionsProtoData;
result->_customMessage = self.customMessage;
result->_groupMetaMessage = self.groupMetaMessage;
result->_hasLegacyMessageState = self.hasLegacyMessageState;
result->_hasSyncedTranscript = self.hasSyncedTranscript;
result->_isVoiceMessage = self.isVoiceMessage;
result->_legacyMessageState = self.legacyMessageState;
result->_legacyWasDelivered = self.legacyWasDelivered;
result->_mostRecentFailureText = self.mostRecentFailureText;
result->_outgoingMessageSchemaVersion = self.outgoingMessageSchemaVersion;
result->_recipientAddressStates = self.recipientAddressStates;
result->_storedMessageState = self.storedMessageState;
result->_wasNotCreatedLocally = self.wasNotCreatedLocally;
return result;
}
- (instancetype)initOutgoingMessageWithBuilder:(TSOutgoingMessageBuilder *)outgoingMessageBuilder
additionalRecipients:(NSArray<ServiceIdObjC *> *)additionalRecipients
explicitRecipients:(NSArray<AciObjC *> *)explicitRecipients

View File

@ -46,14 +46,6 @@ NS_ASSUME_NONNULL_BEGIN
return YES;
}
- (id)copyWithZone:(nullable NSZone *)zone
{
TSInvalidIdentityKeyReceivingErrorMessage *result = [super copyWithZone:zone];
result->_authorId = [self.authorId copy];
result->_envelopeData = self.envelopeData;
return result;
}
// --- CODE GENERATION MARKER
// This snippet is generated by /Scripts/sds_codegen/sds_generate.py. Do not manually edit it, instead run

View File

@ -48,14 +48,6 @@ NS_ASSUME_NONNULL_BEGIN
return YES;
}
- (id)copyWithZone:(nullable NSZone *)zone
{
TSInvalidIdentityKeySendingErrorMessage *result = [super copyWithZone:zone];
result->_messageId = self.messageId;
result->_preKeyBundle = self.preKeyBundle;
return result;
}
// --- CODE GENERATION MARKER
// This snippet is generated by /Scripts/sds_codegen/sds_generate.py. Do not manually edit it, instead run

View File

@ -75,13 +75,6 @@ NS_ASSUME_NONNULL_BEGIN
return YES;
}
- (id)copyWithZone:(nullable NSZone *)zone
{
OWSOutgoingNullMessage *result = [super copyWithZone:zone];
result->_verificationStateSyncMessage = self.verificationStateSyncMessage;
return result;
}
- (instancetype)initWithContactThread:(TSContactThread *)contactThread
verificationStateSyncMessage:(OWSVerificationStateSyncMessage *)verificationStateSyncMessage
transaction:(DBReadTransaction *)transaction

View File

@ -56,16 +56,6 @@ final class OWSOutgoingResendResponse: TSOutgoingMessage {
return true
}
override func copy(with zone: NSZone? = nil) -> Any {
let result = super.copy(with: zone) as! Self
result.derivedContentHint = self.derivedContentHint
result.didAppendSKDM = self.didAppendSKDM
result.originalGroupId = self.originalGroupId
result.originalMessagePlaintext = self.originalMessagePlaintext
result.originalThreadId = self.originalThreadId
return result
}
private(set) var originalMessagePlaintext: Data?
private(set) var originalThreadId: String?
private(set) var originalGroupId: Data?

View File

@ -94,15 +94,6 @@
return YES;
}
- (id)copyWithZone:(nullable NSZone *)zone
{
OWSOutgoingSenderKeyDistributionMessage *result = [super copyWithZone:zone];
result->_isSentOnBehalfOfOnlineMessage = self.isSentOnBehalfOfOnlineMessage;
result->_isSentOnBehalfOfStoryMessage = self.isSentOnBehalfOfStoryMessage;
result->_serializedSKDM = self.serializedSKDM;
return result;
}
- (BOOL)shouldBeSaved
{
return NO;

View File

@ -73,13 +73,6 @@ NS_ASSUME_NONNULL_BEGIN
return YES;
}
- (id)copyWithZone:(nullable NSZone *)zone
{
OWSProfileKeyMessage *result = [super copyWithZone:zone];
result->_profileKey = self.profileKey;
return result;
}
- (BOOL)shouldBeSaved
{
return NO;

View File

@ -68,14 +68,6 @@ NS_ASSUME_NONNULL_BEGIN
return YES;
}
- (id)copyWithZone:(nullable NSZone *)zone
{
OWSUnknownProtocolVersionMessage *result = [super copyWithZone:zone];
result->_protocolVersion = self.protocolVersion;
result->_sender = self.sender;
return result;
}
// --- CODE GENERATION MARKER
// This snippet is generated by /Scripts/sds_codegen/sds_generate.py. Do not manually edit it, instead run

View File

@ -38,13 +38,6 @@ final class OutgoingGroupUpdateMessage: TSOutgoingMessage {
return true
}
override func copy(with zone: NSZone? = nil) -> Any {
let result = super.copy(with: zone) as! Self
result.isDeletingAccount = self.isDeletingAccount
result.isUpdateUrgent = self.isUpdateUrgent
return result
}
private var isUpdateUrgent: Bool = false
private(set) var isDeletingAccount: Bool = false

View File

@ -64,13 +64,6 @@ final class OutgoingResendRequest: TSOutgoingMessage {
return true
}
override func copy(with zone: NSZone? = nil) -> Any {
let result = super.copy(with: zone) as! Self
result.decryptionErrorData = self.decryptionErrorData
result.failedEnvelopeGroupId = self.failedEnvelopeGroupId
return result
}
override var encryptionStyle: EncryptionStyle { .plaintext }
override var isUrgent: Bool { false }

View File

@ -46,13 +46,6 @@ NS_ASSUME_NONNULL_BEGIN
return YES;
}
- (id)copyWithZone:(nullable NSZone *)zone
{
OWSIncomingArchivedPaymentMessage *result = [super copyWithZone:zone];
result->_archivedPaymentInfo = self.archivedPaymentInfo;
return result;
}
// --- CODE GENERATION MARKER
// This snippet is generated by /Scripts/sds_codegen/sds_generate.py. Do not manually edit it, instead run

View File

@ -54,15 +54,6 @@ NS_ASSUME_NONNULL_BEGIN
return YES;
}
- (id)copyWithZone:(nullable NSZone *)zone
{
OWSIncomingPaymentMessage *result = [super copyWithZone:zone];
result->_paymentCancellation = self.paymentCancellation;
result->_paymentNotification = self.paymentNotification;
result->_paymentRequest = self.paymentRequest;
return result;
}
// --- CODE GENERATION MARKER
// This snippet is generated by /Scripts/sds_codegen/sds_generate.py. Do not manually edit it, instead run

View File

@ -74,13 +74,6 @@ NS_ASSUME_NONNULL_BEGIN
return YES;
}
- (id)copyWithZone:(nullable NSZone *)zone
{
OWSOutgoingArchivedPaymentMessage *result = [super copyWithZone:zone];
result->_archivedPaymentInfo = self.archivedPaymentInfo;
return result;
}
- (instancetype)initOutgoingArchivedPaymentMessageWithBuilder:(TSOutgoingMessageBuilder *)messageBuilder
amount:(nullable NSString *)amount
fee:(nullable NSString *)fee

View File

@ -94,15 +94,6 @@ NS_ASSUME_NONNULL_BEGIN
return YES;
}
- (id)copyWithZone:(nullable NSZone *)zone
{
OWSOutgoingPaymentMessage *result = [super copyWithZone:zone];
result->_paymentCancellation = self.paymentCancellation;
result->_paymentNotification = self.paymentNotification;
result->_paymentRequest = self.paymentRequest;
return result;
}
// --- CODE GENERATION MARKER
// This snippet is generated by /Scripts/sds_codegen/sds_generate.py. Do not manually edit it, instead run

View File

@ -116,17 +116,6 @@ NS_ASSUME_NONNULL_BEGIN
return YES;
}
- (id)copyWithZone:(nullable NSZone *)zone
{
OWSOutgoingReactionMessage *result = [super copyWithZone:zone];
result->_createdReaction = self.createdReaction;
result->_emoji = self.emoji;
result->_isRemoving = self.isRemoving;
result->_messageUniqueId = self.messageUniqueId;
result->_previousReaction = self.previousReaction;
return result;
}
- (BOOL)shouldBeSaved
{
return NO;

View File

@ -57,14 +57,6 @@ final class ReceiptMessage: TSOutgoingMessage {
return true
}
override func copy(with zone: NSZone? = nil) -> Any {
let result = super.copy(with: zone) as! Self
result.messageTimestamps = self.messageTimestamps
result.messageUniqueIds = self.messageUniqueIds
result.receiptType = self.receiptType
return result
}
override func shouldSyncTranscript() -> Bool { false }
override var isUrgent: Bool { false }

View File

@ -10,7 +10,7 @@ NS_ASSUME_NONNULL_BEGIN
@class DBReadTransaction;
@interface InstalledSticker : BaseModel <NSCopying>
@interface InstalledSticker : BaseModel
@property (nonatomic, readonly) StickerInfo *info;
@property (nonatomic, readonly, nullable) NSString *emojiString;

View File

@ -37,15 +37,6 @@ NS_ASSUME_NONNULL_BEGIN
return YES;
}
- (id)copyWithZone:(nullable NSZone *)zone
{
InstalledSticker *result = [self copyAndAssignIdsWithZone:zone];
result->_contentType = self.contentType;
result->_emojiString = self.emojiString;
result->_info = self.info;
return result;
}
- (instancetype)initWithInfo:(StickerInfo *)info
contentType:(nullable NSString *)contentType
emojiString:(nullable NSString *)emojiString

View File

@ -306,6 +306,7 @@ public class StickerManager: NSObject {
) {
// If we re-insert a sticker pack, make sure that it
// has a new row id.
_ = stickerPackParam as NSCopying
let stickerPack = stickerPackParam.copy() as! StickerPack
stickerPack.clearRowId()

View File

@ -59,16 +59,6 @@ public class OutgoingStoryMessage: TSOutgoingMessage {
return true
}
override public func copy(with zone: NSZone? = nil) -> Any {
let result = super.copy(with: zone) as! Self
result._storyMessageRowId = self._storyMessageRowId
result.isPrivateStorySend = self.isPrivateStorySend
result.skipSyncTranscript = self.skipSyncTranscript
result.storyAllowsReplies = self.storyAllowsReplies
result.storyMessageId = self.storyMessageId
return result
}
public private(set) var storyMessageId: String!
public private(set) var _storyMessageRowId: NSNumber!
public var storyMessageRowId: Int64! { _storyMessageRowId?.int64Value }

View File

@ -47,14 +47,6 @@ public class OutgoingStorySentMessageTranscript: OWSOutgoingSyncMessage {
return true
}
override public func copy(with zone: NSZone? = nil) -> Any {
let result = super.copy(with: zone) as! Self
result.isRecipientUpdate = self.isRecipientUpdate
result.storyEncodedRecipientStates = self.storyEncodedRecipientStates
result.storyMessageUniqueId = self.storyMessageUniqueId
return result
}
private var storyEncodedRecipientStates: Data?
private var storyMessageUniqueId: String?
private var isRecipientUpdate: NSNumber!

View File

@ -36,12 +36,6 @@ public final class TypingIndicatorMessage: TSOutgoingMessage {
return true
}
override public func copy(with zone: NSZone? = nil) -> Any {
let result = super.copy(with: zone) as! Self
result.action = self.action
return result
}
private var action: TypingIndicatorAction = .started
// MARK: Initializers

View File

@ -19,7 +19,7 @@ NS_ASSUME_NONNULL_BEGIN
// without an associated interaction.
// * Interactions might be deleted, but we need to maintain records of
// all payments.
@interface TSPaymentModel : BaseModel <NSCopying>
@interface TSPaymentModel : BaseModel
// Incoming, outgoing, etc.
//

View File

@ -164,26 +164,6 @@ NS_ASSUME_NONNULL_BEGIN
return YES;
}
- (id)copyWithZone:(nullable NSZone *)zone
{
TSPaymentModel *result = [self copyAndAssignIdsWithZone:zone];
result->_addressUuidString = self.addressUuidString;
result->_createdTimestamp = self.createdTimestamp;
result->_interactionUniqueId = self.interactionUniqueId;
result->_isUnread = self.isUnread;
result->_mcLedgerBlockIndex = self.mcLedgerBlockIndex;
result->_mcReceiptData = self.mcReceiptData;
result->_mcTransactionData = self.mcTransactionData;
result->_memoMessage = self.memoMessage;
result->_mobileCoin = self.mobileCoin;
result->_paymentAmount = self.paymentAmount;
result->_paymentFailure = self.paymentFailure;
result->_paymentState = self.paymentState;
result->_paymentType = self.paymentType;
result->_requestUuidString = self.requestUuidString;
return result;
}
// --- CODE GENERATION MARKER
// This snippet is generated by /Scripts/sds_codegen/sds_generate.py. Do not manually edit it, instead run
@ -552,7 +532,9 @@ NS_ASSUME_NONNULL_BEGIN
+ (MobileCoinPayment *)copy:(nullable MobileCoinPayment *)oldCopy withLedgerBlockIndex:(uint64_t)ledgerBlockIndex
{
OWSAssertDebug(ledgerBlockIndex > 0);
// so that the compiler complains if this doesn't conform to NSCopying
id<NSCopying> oldCopyToCopy = oldCopy;
(void)oldCopyToCopy;
MobileCoinPayment *newCopy = (oldCopy != nil ? [oldCopy copy] : [MobileCoinPayment new]);
newCopy.ledgerBlockIndex = ledgerBlockIndex;
return newCopy;
@ -563,6 +545,9 @@ NS_ASSUME_NONNULL_BEGIN
{
OWSAssertDebug(ledgerBlockTimestamp > 0);
// so that the compiler complains if this doesn't conform to NSCopying
id<NSCopying> oldCopyToCopy = oldCopy;
(void)oldCopyToCopy;
MobileCoinPayment *newCopy = (oldCopy != nil ? [oldCopy copy] : [MobileCoinPayment new]);
newCopy.ledgerBlockTimestamp = ledgerBlockTimestamp;
return newCopy;

View File

@ -105,7 +105,7 @@ NSString *NSStringFromTSPaymentFailure(TSPaymentFailure value);
#pragma mark -
@interface TSPaymentAddress : NSObject <NSCopying>
@interface TSPaymentAddress : NSObject
@property (nonatomic, readonly) TSPaymentCurrency currency;
@property (nonatomic, readonly) NSData *mobileCoinPublicAddressData;

View File

@ -222,14 +222,6 @@ NSString *NSStringFromTSPaymentFailure(TSPaymentFailure value)
return YES;
}
- (id)copyWithZone:(nullable NSZone *)zone
{
TSPaymentAddress *result = [[[self class] allocWithZone:zone] init];
result->_currency = self.currency;
result->_mobileCoinPublicAddressData = self.mobileCoinPublicAddressData;
return result;
}
@end
#pragma mark -

View File

@ -587,6 +587,7 @@ extension TSPaymentModel: TSPaymentBaseModel {
extension TSPaymentAmount: DeepCopyable {
public func deepCopy() throws -> AnyObject {
_ = self as NSCopying
return self.copy() as! Self
}
}

View File

@ -137,7 +137,7 @@ public final class UserProfileNotifications: NSObject {
}
@objc
public final class OWSUserProfile: NSObject, NSCopying, SDSCodableModel, Decodable {
public final class OWSUserProfile: NSObject, SDSCodableModel, Decodable {
public static let databaseTableName = "model_OWSUserProfile"
public static var recordType: UInt { SDSRecordType.userProfile.rawValue }
@ -325,10 +325,6 @@ public final class OWSUserProfile: NSObject, NSCopying, SDSCodableModel, Decodab
self.isPhoneNumberShared = isPhoneNumberShared
}
public func copy(with zone: NSZone? = nil) -> Any {
return shallowCopy()
}
@objc
public func shallowCopy() -> OWSUserProfile {
return OWSUserProfile(

View File

@ -336,7 +336,7 @@ public struct KeyValueStore {
return self.getArray(key, ofClass: NSString.self, transaction: transaction) as [String]?
}
public func getSet<DecodedObject: NSObject & NSSecureCoding>(_ key: String, ofClass cls: DecodedObject.Type, transaction: DBReadTransaction) -> Set<DecodedObject>? {
public func getSet<DecodedObject: NSObject & NSCopying & NSSecureCoding>(_ key: String, ofClass cls: DecodedObject.Type, transaction: DBReadTransaction) -> Set<DecodedObject>? {
return self.getObject(key, ofClasses: [NSSet.self, cls], transaction: transaction) as? Set<DecodedObject>
}

View File

@ -106,15 +106,6 @@ lastVisibleSortIdOnScreenPercentageObsolete:lastVisibleSortIdOnScreenPercentageO
return YES;
}
- (id)copyWithZone:(nullable NSZone *)zone
{
TSContactThread *result = [super copyWithZone:zone];
result->_contactPhoneNumber = self.contactPhoneNumber;
result->_contactUUID = self.contactUUID;
result->_hasDismissedOffers = self.hasDismissedOffers;
return result;
}
- (instancetype)initWithContactUUID:(nullable NSString *)contactUUID
contactPhoneNumber:(nullable NSString *)contactPhoneNumber
{

View File

@ -97,13 +97,6 @@ lastVisibleSortIdOnScreenPercentageObsolete:lastVisibleSortIdOnScreenPercentageO
return YES;
}
- (id)copyWithZone:(nullable NSZone *)zone
{
TSGroupThread *result = [super copyWithZone:zone];
result->_groupModel = self.groupModel;
return result;
}
- (instancetype)initWithGroupModel:(TSGroupModelV2 *)groupModel
{
OWSAssertDebug(groupModel);

View File

@ -25,6 +25,7 @@ extension TSGroupThread {
}
}
_ = newGroupModel as NSCopying
groupThread.groupModel = newGroupModel.copy() as! TSGroupModel
}

View File

@ -49,15 +49,6 @@
return YES;
}
- (id)copyWithZone:(nullable NSZone *)zone
{
TSPrivateStoryThread *result = [super copyWithZone:zone];
result->_addresses = self.addresses;
result->_allowsReplies = self.allowsReplies;
result->_name = self.name;
return result;
}
- (instancetype)initWithName:(NSString *)name allowsReplies:(BOOL)allowsReplies viewMode:(TSThreadStoryViewMode)viewMode
{
NSString *uniqueId = [[self class] generateUniqueId];

View File

@ -153,6 +153,8 @@ public class ContactShareViewModel: NSObject {
}
public func copyForRendering() -> ContactShareViewModel {
// for compiler enforcement
_ = dbRecord as NSCopying
let newDbRecord = dbRecord.copy() as! OWSContact
return ContactShareViewModel(
contactShareRecord: newDbRecord,