mirror of
https://github.com/signalapp/Signal-iOS.git
synced 2025-12-05 01:10:41 +00:00
Allow deprecated_sourceDeviceId to be nil
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
"nsnumber_types": {
|
||||
"TSThread.archivedAsOfMessageSortId": "UInt64",
|
||||
"TSIncomingMessage.serverTimestamp": "UInt64",
|
||||
"TSIncomingMessage.deprecated_sourceDeviceId": "UInt32",
|
||||
"TSOutgoingMessageRecipientState.deliveryTimestamp": "UInt64",
|
||||
"TSOutgoingMessageRecipientState.readTimestamp": "UInt64",
|
||||
"OWSBackupFragment.uncompressedDataLength": "UInt64",
|
||||
|
||||
@@ -1181,8 +1181,8 @@ public struct %s: SDSRecord {
|
||||
%sSerializer.table
|
||||
}
|
||||
|
||||
public static var databaseTableName: String {
|
||||
%sSerializer.table.tableName
|
||||
public static var databaseTableName: String {
|
||||
%sSerializer.table.tableName
|
||||
}
|
||||
|
||||
public var id: Int64?
|
||||
@@ -2090,7 +2090,7 @@ public extension %(class_name)s {
|
||||
swift_body += """
|
||||
return anyFetch(uniqueId: uniqueId, transaction: transaction, ignoreCache: false)
|
||||
}
|
||||
|
||||
|
||||
// Fetches a single model by "unique id".
|
||||
class func anyFetch(uniqueId: String,
|
||||
transaction: SDSAnyReadTransaction,
|
||||
@@ -2545,7 +2545,7 @@ class %sSerializer: SDSSerializer {
|
||||
@objc
|
||||
public extension %(model_name)s {
|
||||
// We're not using this method at the moment,
|
||||
// but we might use it for validation of
|
||||
// but we might use it for validation of
|
||||
// other deep copy methods.
|
||||
func deepCopyUsingRecord() throws -> %(model_name)s {
|
||||
guard let record = try asRecord() as? %(record_name)s else {
|
||||
|
||||
@@ -106,7 +106,7 @@ class TSIncomingMessageSerializer: SDSSerializer {
|
||||
let recipientAddressStates: Data? = nil
|
||||
let sender: Data? = nil
|
||||
let serverTimestamp: UInt64? = archiveOptionalNSNumber(model.serverTimestamp, conversion: { $0.uint64Value })
|
||||
let deprecated_sourceDeviceId: UInt32? = model.deprecated_sourceDeviceId
|
||||
let deprecated_sourceDeviceId: UInt32? = archiveOptionalNSNumber(model.deprecated_sourceDeviceId, conversion: { $0.uint32Value })
|
||||
let storedMessageState: TSOutgoingMessageState? = nil
|
||||
let storedShouldStartExpireTimer: Bool? = model.storedShouldStartExpireTimer
|
||||
let unregisteredAddress: Data? = nil
|
||||
|
||||
@@ -105,7 +105,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
wasRemotelyDeleted:(BOOL)wasRemotelyDeleted
|
||||
authorPhoneNumber:(nullable NSString *)authorPhoneNumber
|
||||
authorUUID:(nullable NSString *)authorUUID
|
||||
deprecated_sourceDeviceId:(unsigned int)deprecated_sourceDeviceId
|
||||
deprecated_sourceDeviceId:(nullable NSNumber *)deprecated_sourceDeviceId
|
||||
read:(BOOL)read
|
||||
serverDeliveryTimestamp:(uint64_t)serverDeliveryTimestamp
|
||||
serverGuid:(nullable NSString *)serverGuid
|
||||
@@ -124,7 +124,7 @@ NS_DESIGNATED_INITIALIZER NS_SWIFT_NAME(init(grdbId:uniqueId:receivedAtTimestamp
|
||||
/// In other words, DONT USE IT.
|
||||
/// Kept only so sds codegen outputs code with backwards compatibility with our sql
|
||||
/// table without needing to migrate or reindex TSInteraction.
|
||||
@property (nonatomic, readonly) UInt32 deprecated_sourceDeviceId;
|
||||
@property (nonatomic, readonly, nullable) NSNumber *deprecated_sourceDeviceId;
|
||||
|
||||
@property (nonatomic, readonly) SignalServiceAddress *authorAddress;
|
||||
@property (nonatomic, readonly, nullable) NSString *authorPhoneNumber;
|
||||
|
||||
@@ -61,7 +61,7 @@ const NSUInteger TSIncomingMessageSchemaVersion = 1;
|
||||
|
||||
_authorUUID = incomingMessageBuilder.authorAciObjC.serviceIdUppercaseString;
|
||||
_authorPhoneNumber = incomingMessageBuilder.authorE164ObjC.stringValue;
|
||||
_deprecated_sourceDeviceId = 1;
|
||||
_deprecated_sourceDeviceId = nil;
|
||||
_read = incomingMessageBuilder.read;
|
||||
if (incomingMessageBuilder.serverTimestamp > 0) {
|
||||
_serverTimestamp = [NSNumber numberWithUnsignedLongLong:incomingMessageBuilder.serverTimestamp];
|
||||
@@ -114,7 +114,7 @@ const NSUInteger TSIncomingMessageSchemaVersion = 1;
|
||||
wasRemotelyDeleted:(BOOL)wasRemotelyDeleted
|
||||
authorPhoneNumber:(nullable NSString *)authorPhoneNumber
|
||||
authorUUID:(nullable NSString *)authorUUID
|
||||
deprecated_sourceDeviceId:(unsigned int)deprecated_sourceDeviceId
|
||||
deprecated_sourceDeviceId:(nullable NSNumber *)deprecated_sourceDeviceId
|
||||
read:(BOOL)read
|
||||
serverDeliveryTimestamp:(uint64_t)serverDeliveryTimestamp
|
||||
serverGuid:(nullable NSString *)serverGuid
|
||||
|
||||
@@ -633,7 +633,7 @@ extension TSInteraction {
|
||||
let wasRemotelyDeleted: Bool = try SDSDeserialization.required(record.wasRemotelyDeleted, name: "wasRemotelyDeleted")
|
||||
let authorPhoneNumber: String? = record.authorPhoneNumber
|
||||
let authorUUID: String? = record.authorUUID
|
||||
let deprecated_sourceDeviceId: UInt32 = try SDSDeserialization.required(record.deprecated_sourceDeviceId, name: "deprecated_sourceDeviceId")
|
||||
let deprecated_sourceDeviceId: NSNumber? = SDSDeserialization.optionalNumericAsNSNumber(record.deprecated_sourceDeviceId, name: "deprecated_sourceDeviceId", conversion: { NSNumber(value: $0) })
|
||||
let read: Bool = try SDSDeserialization.required(record.read, name: "read")
|
||||
let serverDeliveryTimestamp: UInt64 = try SDSDeserialization.required(record.serverDeliveryTimestamp, name: "serverDeliveryTimestamp")
|
||||
let serverGuid: String? = record.serverGuid
|
||||
@@ -722,7 +722,7 @@ extension TSInteraction {
|
||||
let wasRemotelyDeleted: Bool = try SDSDeserialization.required(record.wasRemotelyDeleted, name: "wasRemotelyDeleted")
|
||||
let authorPhoneNumber: String? = record.authorPhoneNumber
|
||||
let authorUUID: String? = record.authorUUID
|
||||
let deprecated_sourceDeviceId: UInt32 = try SDSDeserialization.required(record.deprecated_sourceDeviceId, name: "deprecated_sourceDeviceId")
|
||||
let deprecated_sourceDeviceId: NSNumber? = SDSDeserialization.optionalNumericAsNSNumber(record.deprecated_sourceDeviceId, name: "deprecated_sourceDeviceId", conversion: { NSNumber(value: $0) })
|
||||
let read: Bool = try SDSDeserialization.required(record.read, name: "read")
|
||||
let serverDeliveryTimestamp: UInt64 = try SDSDeserialization.required(record.serverDeliveryTimestamp, name: "serverDeliveryTimestamp")
|
||||
let serverGuid: String? = record.serverGuid
|
||||
@@ -1666,7 +1666,7 @@ extension TSInteraction {
|
||||
let wasRemotelyDeleted: Bool = try SDSDeserialization.required(record.wasRemotelyDeleted, name: "wasRemotelyDeleted")
|
||||
let authorPhoneNumber: String? = record.authorPhoneNumber
|
||||
let authorUUID: String? = record.authorUUID
|
||||
let deprecated_sourceDeviceId: UInt32 = try SDSDeserialization.required(record.deprecated_sourceDeviceId, name: "deprecated_sourceDeviceId")
|
||||
let deprecated_sourceDeviceId: NSNumber? = SDSDeserialization.optionalNumericAsNSNumber(record.deprecated_sourceDeviceId, name: "deprecated_sourceDeviceId", conversion: { NSNumber(value: $0) })
|
||||
let read: Bool = try SDSDeserialization.required(record.read, name: "read")
|
||||
let serverDeliveryTimestamp: UInt64 = try SDSDeserialization.required(record.serverDeliveryTimestamp, name: "serverDeliveryTimestamp")
|
||||
let serverGuid: String? = record.serverGuid
|
||||
@@ -4517,7 +4517,7 @@ extension TSInteraction: DeepCopyable {
|
||||
let wasRemotelyDeleted: Bool = modelToCopy.wasRemotelyDeleted
|
||||
let authorPhoneNumber: String? = modelToCopy.authorPhoneNumber
|
||||
let authorUUID: String? = modelToCopy.authorUUID
|
||||
let deprecated_sourceDeviceId: UInt32 = modelToCopy.deprecated_sourceDeviceId
|
||||
let deprecated_sourceDeviceId: NSNumber? = modelToCopy.deprecated_sourceDeviceId
|
||||
let read: Bool = modelToCopy.wasRead
|
||||
let serverDeliveryTimestamp: UInt64 = modelToCopy.serverDeliveryTimestamp
|
||||
let serverGuid: String? = modelToCopy.serverGuid
|
||||
@@ -4697,7 +4697,7 @@ extension TSInteraction: DeepCopyable {
|
||||
let wasRemotelyDeleted: Bool = modelToCopy.wasRemotelyDeleted
|
||||
let authorPhoneNumber: String? = modelToCopy.authorPhoneNumber
|
||||
let authorUUID: String? = modelToCopy.authorUUID
|
||||
let deprecated_sourceDeviceId: UInt32 = modelToCopy.deprecated_sourceDeviceId
|
||||
let deprecated_sourceDeviceId: NSNumber? = modelToCopy.deprecated_sourceDeviceId
|
||||
let read: Bool = modelToCopy.wasRead
|
||||
let serverDeliveryTimestamp: UInt64 = modelToCopy.serverDeliveryTimestamp
|
||||
let serverGuid: String? = modelToCopy.serverGuid
|
||||
@@ -4863,7 +4863,7 @@ extension TSInteraction: DeepCopyable {
|
||||
let wasRemotelyDeleted: Bool = modelToCopy.wasRemotelyDeleted
|
||||
let authorPhoneNumber: String? = modelToCopy.authorPhoneNumber
|
||||
let authorUUID: String? = modelToCopy.authorUUID
|
||||
let deprecated_sourceDeviceId: UInt32 = modelToCopy.deprecated_sourceDeviceId
|
||||
let deprecated_sourceDeviceId: NSNumber? = modelToCopy.deprecated_sourceDeviceId
|
||||
let read: Bool = modelToCopy.wasRead
|
||||
let serverDeliveryTimestamp: UInt64 = modelToCopy.serverDeliveryTimestamp
|
||||
let serverGuid: String? = modelToCopy.serverGuid
|
||||
|
||||
@@ -106,7 +106,7 @@ class OWSIncomingArchivedPaymentMessageSerializer: SDSSerializer {
|
||||
let recipientAddressStates: Data? = nil
|
||||
let sender: Data? = nil
|
||||
let serverTimestamp: UInt64? = archiveOptionalNSNumber(model.serverTimestamp, conversion: { $0.uint64Value })
|
||||
let deprecated_sourceDeviceId: UInt32? = model.deprecated_sourceDeviceId
|
||||
let deprecated_sourceDeviceId: UInt32? = archiveOptionalNSNumber(model.deprecated_sourceDeviceId, conversion: { $0.uint32Value })
|
||||
let storedMessageState: TSOutgoingMessageState? = nil
|
||||
let storedShouldStartExpireTimer: Bool? = model.storedShouldStartExpireTimer
|
||||
let unregisteredAddress: Data? = nil
|
||||
|
||||
@@ -99,7 +99,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
wasRemotelyDeleted:(BOOL)wasRemotelyDeleted
|
||||
authorPhoneNumber:(nullable NSString *)authorPhoneNumber
|
||||
authorUUID:(nullable NSString *)authorUUID
|
||||
deprecated_sourceDeviceId:(unsigned int)deprecated_sourceDeviceId
|
||||
deprecated_sourceDeviceId:(nullable NSNumber *)deprecated_sourceDeviceId
|
||||
read:(BOOL)read
|
||||
serverDeliveryTimestamp:(uint64_t)serverDeliveryTimestamp
|
||||
serverGuid:(nullable NSString *)serverGuid
|
||||
|
||||
@@ -64,7 +64,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
wasRemotelyDeleted:(BOOL)wasRemotelyDeleted
|
||||
authorPhoneNumber:(nullable NSString *)authorPhoneNumber
|
||||
authorUUID:(nullable NSString *)authorUUID
|
||||
deprecated_sourceDeviceId:(unsigned int)deprecated_sourceDeviceId
|
||||
deprecated_sourceDeviceId:(nullable NSNumber *)deprecated_sourceDeviceId
|
||||
read:(BOOL)read
|
||||
serverDeliveryTimestamp:(uint64_t)serverDeliveryTimestamp
|
||||
serverGuid:(nullable NSString *)serverGuid
|
||||
|
||||
@@ -106,7 +106,7 @@ class OWSIncomingPaymentMessageSerializer: SDSSerializer {
|
||||
let recipientAddressStates: Data? = nil
|
||||
let sender: Data? = nil
|
||||
let serverTimestamp: UInt64? = archiveOptionalNSNumber(model.serverTimestamp, conversion: { $0.uint64Value })
|
||||
let deprecated_sourceDeviceId: UInt32? = model.deprecated_sourceDeviceId
|
||||
let deprecated_sourceDeviceId: UInt32? = archiveOptionalNSNumber(model.deprecated_sourceDeviceId, conversion: { $0.uint32Value })
|
||||
let storedMessageState: TSOutgoingMessageState? = nil
|
||||
let storedShouldStartExpireTimer: Bool? = model.storedShouldStartExpireTimer
|
||||
let unregisteredAddress: Data? = nil
|
||||
|
||||
@@ -99,7 +99,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
wasRemotelyDeleted:(BOOL)wasRemotelyDeleted
|
||||
authorPhoneNumber:(nullable NSString *)authorPhoneNumber
|
||||
authorUUID:(nullable NSString *)authorUUID
|
||||
deprecated_sourceDeviceId:(unsigned int)deprecated_sourceDeviceId
|
||||
deprecated_sourceDeviceId:(nullable NSNumber *)deprecated_sourceDeviceId
|
||||
read:(BOOL)read
|
||||
serverDeliveryTimestamp:(uint64_t)serverDeliveryTimestamp
|
||||
serverGuid:(nullable NSString *)serverGuid
|
||||
|
||||
@@ -65,7 +65,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
wasRemotelyDeleted:(BOOL)wasRemotelyDeleted
|
||||
authorPhoneNumber:(nullable NSString *)authorPhoneNumber
|
||||
authorUUID:(nullable NSString *)authorUUID
|
||||
deprecated_sourceDeviceId:(unsigned int)deprecated_sourceDeviceId
|
||||
deprecated_sourceDeviceId:(nullable NSNumber *)deprecated_sourceDeviceId
|
||||
read:(BOOL)read
|
||||
serverDeliveryTimestamp:(uint64_t)serverDeliveryTimestamp
|
||||
serverGuid:(nullable NSString *)serverGuid
|
||||
|
||||
Reference in New Issue
Block a user