mirror of
https://github.com/signalapp/Signal-iOS.git
synced 2025-12-05 01:10:41 +00:00
remove NSObject OWS category
This commit is contained in:
@@ -921,7 +921,7 @@ public func serializedData() throws -> Data {
|
||||
writer.add("guard proto.%s else {" % field.has_accessor_name())
|
||||
writer.push_indent()
|
||||
writer.add(
|
||||
'throw %s.invalidProtobuf(description: "\\(Self.logTag()) missing required field: %s")'
|
||||
'throw %s.invalidProtobuf(description: "[\\(Self.self)] missing required field: %s")'
|
||||
% (
|
||||
writer.invalid_protobuf_error_name,
|
||||
field.name_swift,
|
||||
|
||||
@@ -985,9 +985,7 @@
|
||||
668A00E42C2B5F35007B8808 /* OWSLocalizedString.swift in Sources */ = {isa = PBXBuildFile; fileRef = 668A00E32C2B5F35007B8808 /* OWSLocalizedString.swift */; };
|
||||
668A00E92C2B5F59007B8808 /* TSMutex.swift in Sources */ = {isa = PBXBuildFile; fileRef = 668A00E62C2B5F58007B8808 /* TSMutex.swift */; };
|
||||
668A00F42C2B5F81007B8808 /* NSDate+OWS.m in Sources */ = {isa = PBXBuildFile; fileRef = 668A00EC2C2B5F80007B8808 /* NSDate+OWS.m */; };
|
||||
668A00F52C2B5F81007B8808 /* NSObject+OWS.h in Headers */ = {isa = PBXBuildFile; fileRef = 668A00ED2C2B5F80007B8808 /* NSObject+OWS.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
668A00F82C2B5F81007B8808 /* NSDate+OWS.h in Headers */ = {isa = PBXBuildFile; fileRef = 668A00F02C2B5F81007B8808 /* NSDate+OWS.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
668A00F92C2B5F81007B8808 /* NSObject+OWS.m in Sources */ = {isa = PBXBuildFile; fileRef = 668A00F12C2B5F81007B8808 /* NSObject+OWS.m */; };
|
||||
668A01002C2B5FC8007B8808 /* OWSSwiftUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 668A00FD2C2B5FC8007B8808 /* OWSSwiftUtils.swift */; };
|
||||
668A01012C2B5FC8007B8808 /* OWSAsserts.h in Headers */ = {isa = PBXBuildFile; fileRef = 668A00FE2C2B5FC8007B8808 /* OWSAsserts.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
668A01022C2B5FC8007B8808 /* OWSAsserts.m in Sources */ = {isa = PBXBuildFile; fileRef = 668A00FF2C2B5FC8007B8808 /* OWSAsserts.m */; };
|
||||
@@ -4811,9 +4809,7 @@
|
||||
668A00E32C2B5F35007B8808 /* OWSLocalizedString.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OWSLocalizedString.swift; sourceTree = "<group>"; };
|
||||
668A00E62C2B5F58007B8808 /* TSMutex.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TSMutex.swift; sourceTree = "<group>"; };
|
||||
668A00EC2C2B5F80007B8808 /* NSDate+OWS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDate+OWS.m"; sourceTree = "<group>"; };
|
||||
668A00ED2C2B5F80007B8808 /* NSObject+OWS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSObject+OWS.h"; sourceTree = "<group>"; };
|
||||
668A00F02C2B5F81007B8808 /* NSDate+OWS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDate+OWS.h"; sourceTree = "<group>"; };
|
||||
668A00F12C2B5F81007B8808 /* NSObject+OWS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSObject+OWS.m"; sourceTree = "<group>"; };
|
||||
668A00FD2C2B5FC8007B8808 /* OWSSwiftUtils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OWSSwiftUtils.swift; sourceTree = "<group>"; };
|
||||
668A00FE2C2B5FC8007B8808 /* OWSAsserts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OWSAsserts.h; sourceTree = "<group>"; };
|
||||
668A00FF2C2B5FC8007B8808 /* OWSAsserts.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OWSAsserts.m; sourceTree = "<group>"; };
|
||||
@@ -14020,8 +14016,6 @@
|
||||
668A00EC2C2B5F80007B8808 /* NSDate+OWS.m */,
|
||||
507E1BDE2A0E13B100650611 /* NSKeyedUnarchiver+SSK.swift */,
|
||||
F9C5CB39289453B200548EEE /* NSNotificationCenter+OWS.swift */,
|
||||
668A00ED2C2B5F80007B8808 /* NSObject+OWS.h */,
|
||||
668A00F12C2B5F81007B8808 /* NSObject+OWS.m */,
|
||||
F9C5CB1F289453B200548EEE /* NSRegularExpression+SSK.swift */,
|
||||
72976BF12BDCF00C0054FAC2 /* NSTimer+OWS.swift */,
|
||||
F9C5CB44289453B200548EEE /* OffMainThreadTimer.swift */,
|
||||
@@ -14197,7 +14191,6 @@
|
||||
F9C5CDA7289453B400548EEE /* IncomingGroupsV2MessageJob.h in Headers */,
|
||||
F9C5CC0A289453B300548EEE /* InstalledSticker.h in Headers */,
|
||||
668A00F82C2B5F81007B8808 /* NSDate+OWS.h in Headers */,
|
||||
668A00F52C2B5F81007B8808 /* NSObject+OWS.h in Headers */,
|
||||
F9C5CBC6289453B300548EEE /* OutgoingPaymentSyncMessage.h in Headers */,
|
||||
F9C5CC1E289453B300548EEE /* OWSAddToContactsOfferMessage.h in Headers */,
|
||||
F9C5CC84289453B300548EEE /* OWSAddToProfileWhitelistOfferMessage.h in Headers */,
|
||||
@@ -17596,7 +17589,6 @@
|
||||
668A00F42C2B5F81007B8808 /* NSDate+OWS.m in Sources */,
|
||||
507E1BDF2A0E13B100650611 /* NSKeyedUnarchiver+SSK.swift in Sources */,
|
||||
F9C5CE0B289453B400548EEE /* NSNotificationCenter+OWS.swift in Sources */,
|
||||
668A00F92C2B5F81007B8808 /* NSObject+OWS.m in Sources */,
|
||||
66F2CE212A3CBE4A00519342 /* NSRangedValue.swift in Sources */,
|
||||
F9C5CDF1289453B400548EEE /* NSRegularExpression+SSK.swift in Sources */,
|
||||
72976BF22BDCF00C0054FAC2 /* NSTimer+OWS.swift in Sources */,
|
||||
|
||||
@@ -113,7 +113,7 @@ class MemberRequestView: UIStackView {
|
||||
|
||||
GroupViewUtils.updateGroupWithActivityIndicator(
|
||||
fromViewController: fromViewController,
|
||||
updateDescription: self.logTag,
|
||||
updateDescription: "[\(type(of: self))]",
|
||||
updateBlock: {
|
||||
return try await GroupManager.cancelRequestToJoin(groupModel: groupModelV2)
|
||||
},
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import <SignalServiceKit/NSObject+OWS.h>
|
||||
#import <SignalServiceKit/OWSAsserts.h>
|
||||
#import <SignalServiceKit/SDSDatabaseStorage+Objc.h>
|
||||
#endif
|
||||
|
||||
@@ -180,7 +180,7 @@ private extension GroupLinkPromotionActionSheet {
|
||||
approveNewMembers: approveNewMembers)
|
||||
GroupLinkViewUtils.updateLinkMode(groupModelV2: groupModelV2,
|
||||
linkMode: linkMode,
|
||||
description: self.logTag,
|
||||
description: "[\(type(of: self))]",
|
||||
fromViewController: actionSheetController) { [weak self] (groupThread) in
|
||||
guard let groupModelV2 = groupThread.groupModel as? TSGroupModelV2 else {
|
||||
owsFailDebug("Invalid groupModel.")
|
||||
|
||||
@@ -130,7 +130,7 @@ private extension AddGroupMembersViewController {
|
||||
|
||||
GroupViewUtils.updateGroupWithActivityIndicator(
|
||||
fromViewController: self,
|
||||
updateDescription: self.logTag,
|
||||
updateDescription: "[\(type(of: self))]",
|
||||
updateBlock: {
|
||||
_ = try await GroupManager.addOrInvite(
|
||||
serviceIds: newServiceIds,
|
||||
|
||||
@@ -156,7 +156,7 @@ public class AddToGroupViewController: OWSTableViewController2 {
|
||||
|
||||
GroupViewUtils.updateGroupWithActivityIndicator(
|
||||
fromViewController: self,
|
||||
updateDescription: self.logTag,
|
||||
updateDescription: "[\(type(of: self))]",
|
||||
updateBlock: {
|
||||
_ = try await GroupManager.addOrInvite(
|
||||
serviceIds: [serviceId],
|
||||
|
||||
@@ -289,7 +289,7 @@ class GroupAttributesEditorHelper: NSObject {
|
||||
|
||||
GroupViewUtils.updateGroupWithActivityIndicator(
|
||||
fromViewController: fromViewController,
|
||||
updateDescription: self.logTag,
|
||||
updateDescription: "[\(type(of: self))]",
|
||||
updateBlock: {
|
||||
_ = try await GroupManager.updateGroupAttributes(
|
||||
title: currentTitle,
|
||||
|
||||
@@ -367,7 +367,7 @@ private extension GroupLinkViewController {
|
||||
func updateLinkMode(linkMode: GroupsV2LinkMode) {
|
||||
GroupLinkViewUtils.updateLinkMode(groupModelV2: groupModelV2,
|
||||
linkMode: linkMode,
|
||||
description: self.logTag,
|
||||
description: "[\(type(of: self))]",
|
||||
fromViewController: self) { [weak self] groupThread in
|
||||
self?.updateView(groupThread: groupThread)
|
||||
}
|
||||
@@ -376,7 +376,7 @@ private extension GroupLinkViewController {
|
||||
func resetLink() {
|
||||
GroupViewUtils.updateGroupWithActivityIndicator(
|
||||
fromViewController: self,
|
||||
updateDescription: self.logTag,
|
||||
updateDescription: "[\(type(of: self))]",
|
||||
updateBlock: {
|
||||
return try await GroupManager.resetLinkV2(groupModel: self.groupModelV2)
|
||||
},
|
||||
|
||||
@@ -466,7 +466,7 @@ private extension GroupMemberRequestsAndInvitesViewController {
|
||||
|
||||
GroupViewUtils.updateGroupWithActivityIndicator(
|
||||
fromViewController: self,
|
||||
updateDescription: self.logTag,
|
||||
updateDescription: "[\(type(of: self))]",
|
||||
updateBlock: {
|
||||
try await GroupManager.removeFromGroupOrRevokeInviteV2(groupModel: groupModelV2, serviceIds: serviceIds)
|
||||
},
|
||||
@@ -484,7 +484,7 @@ private extension GroupMemberRequestsAndInvitesViewController {
|
||||
|
||||
GroupViewUtils.updateGroupWithActivityIndicator(
|
||||
fromViewController: self,
|
||||
updateDescription: self.logTag,
|
||||
updateDescription: "[\(type(of: self))]",
|
||||
updateBlock: {
|
||||
try await GroupManager.revokeInvalidInvites(groupModel: groupModelV2)
|
||||
},
|
||||
@@ -543,7 +543,7 @@ fileprivate extension GroupMemberRequestsAndInvitesViewController {
|
||||
|
||||
GroupViewUtils.updateGroupWithActivityIndicator(
|
||||
fromViewController: self,
|
||||
updateDescription: self.logTag,
|
||||
updateDescription: "[\(type(of: self))]",
|
||||
updateBlock: {
|
||||
try await GroupManager.acceptOrDenyMemberRequestsV2(groupModel: groupModelV2, aci: aci, shouldAccept: shouldAccept)
|
||||
},
|
||||
|
||||
@@ -123,7 +123,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- (NSString *)debugDescription
|
||||
{
|
||||
return [NSString
|
||||
stringWithFormat:@"%@ with message timestamps: %lu", self.logTag, (unsigned long)self.messageTimestamps.count];
|
||||
stringWithFormat:@"[%@] with message timestamps: %lu", self.class, (unsigned long)self.messageTimestamps.count];
|
||||
}
|
||||
|
||||
- (NSSet<NSString *> *)relatedUniqueIds
|
||||
|
||||
@@ -178,7 +178,7 @@ public class SMKSecretSessionCipher: NSObject {
|
||||
protocolContext: StoreContext?
|
||||
) throws -> SMKDecryptResult {
|
||||
guard timestamp > 0 else {
|
||||
throw SMKError.assertionError(description: "\(logTag) invalid timestamp")
|
||||
throw SMKError.assertionError(description: "[\(type(of: self))] invalid timestamp")
|
||||
}
|
||||
|
||||
// Allow nil contexts for testing.
|
||||
@@ -191,10 +191,10 @@ public class SMKSecretSessionCipher: NSObject {
|
||||
|
||||
// NOTE: We use the sender properties from the sender certificate, not from this class' properties.
|
||||
guard sender.deviceId <= Int32.max else {
|
||||
throw SMKError.assertionError(description: "\(logTag) Invalid senderDeviceId.")
|
||||
throw SMKError.assertionError(description: "[\(type(of: self))] Invalid senderDeviceId.")
|
||||
}
|
||||
guard let senderAci = Aci.parseFrom(aciString: sender.uuidString) else {
|
||||
throw SMKError.assertionError(description: "\(logTag) Invalid senderAci.")
|
||||
throw SMKError.assertionError(description: "[\(type(of: self))] Invalid senderAci.")
|
||||
}
|
||||
|
||||
if localIdentifiers.aci == senderAci && sender.deviceId == localDeviceId {
|
||||
@@ -242,7 +242,7 @@ public class SMKSecretSessionCipher: NSObject {
|
||||
// NOTE: We use the sender properties from the sender certificate, not from this class' properties.
|
||||
let sender = messageContent.senderCertificate.sender
|
||||
guard sender.deviceId >= 0 && sender.deviceId <= Int32.max else {
|
||||
throw SMKError.assertionError(description: "\(logTag) Invalid senderDeviceId.")
|
||||
throw SMKError.assertionError(description: "[\(type(of: self))] Invalid senderDeviceId.")
|
||||
}
|
||||
|
||||
// switch (message.getType()) {
|
||||
@@ -283,7 +283,7 @@ public class SMKSecretSessionCipher: NSObject {
|
||||
plaintextData = plaintextMessage.body
|
||||
case let unknownType:
|
||||
throw SMKError.assertionError(
|
||||
description: "\(logTag) Not prepared to handle this message type: \(unknownType.rawValue)")
|
||||
description: "[\(type(of: self))] Not prepared to handle this message type: \(unknownType.rawValue)")
|
||||
}
|
||||
return Data(plaintextData)
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ public class FingerprintProtoLogicalFingerprint: NSObject, Codable, NSSecureCodi
|
||||
|
||||
fileprivate convenience init(_ proto: FingerprintProtos_LogicalFingerprint) throws {
|
||||
guard proto.hasIdentityData else {
|
||||
throw FingerprintProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: identityData")
|
||||
throw FingerprintProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: identityData")
|
||||
}
|
||||
let identityData = proto.identityData
|
||||
|
||||
@@ -216,17 +216,17 @@ public class FingerprintProtoLogicalFingerprints: NSObject, Codable, NSSecureCod
|
||||
|
||||
fileprivate convenience init(_ proto: FingerprintProtos_LogicalFingerprints) throws {
|
||||
guard proto.hasVersion else {
|
||||
throw FingerprintProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: version")
|
||||
throw FingerprintProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: version")
|
||||
}
|
||||
let version = proto.version
|
||||
|
||||
guard proto.hasLocalFingerprint else {
|
||||
throw FingerprintProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: localFingerprint")
|
||||
throw FingerprintProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: localFingerprint")
|
||||
}
|
||||
let localFingerprint = try FingerprintProtoLogicalFingerprint(proto.localFingerprint)
|
||||
|
||||
guard proto.hasRemoteFingerprint else {
|
||||
throw FingerprintProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: remoteFingerprint")
|
||||
throw FingerprintProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: remoteFingerprint")
|
||||
}
|
||||
let remoteFingerprint = try FingerprintProtoLogicalFingerprint(proto.remoteFingerprint)
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ public class ProvisioningProtoProvisioningUuid: NSObject, Codable, NSSecureCodin
|
||||
|
||||
fileprivate convenience init(_ proto: ProvisioningProtos_ProvisioningUuid) throws {
|
||||
guard proto.hasUuid else {
|
||||
throw ProvisioningProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: uuid")
|
||||
throw ProvisioningProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: uuid")
|
||||
}
|
||||
let uuid = proto.uuid
|
||||
|
||||
@@ -211,12 +211,12 @@ public class ProvisioningProtoProvisionEnvelope: NSObject, Codable, NSSecureCodi
|
||||
|
||||
fileprivate convenience init(_ proto: ProvisioningProtos_ProvisionEnvelope) throws {
|
||||
guard proto.hasPublicKey else {
|
||||
throw ProvisioningProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: publicKey")
|
||||
throw ProvisioningProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: publicKey")
|
||||
}
|
||||
let publicKey = proto.publicKey
|
||||
|
||||
guard proto.hasBody else {
|
||||
throw ProvisioningProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: body")
|
||||
throw ProvisioningProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: body")
|
||||
}
|
||||
let body = proto.body
|
||||
|
||||
@@ -513,32 +513,32 @@ public class ProvisioningProtoProvisionMessage: NSObject, Codable, NSSecureCodin
|
||||
|
||||
fileprivate convenience init(_ proto: ProvisioningProtos_ProvisionMessage) throws {
|
||||
guard proto.hasAciIdentityKeyPublic else {
|
||||
throw ProvisioningProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: aciIdentityKeyPublic")
|
||||
throw ProvisioningProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: aciIdentityKeyPublic")
|
||||
}
|
||||
let aciIdentityKeyPublic = proto.aciIdentityKeyPublic
|
||||
|
||||
guard proto.hasAciIdentityKeyPrivate else {
|
||||
throw ProvisioningProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: aciIdentityKeyPrivate")
|
||||
throw ProvisioningProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: aciIdentityKeyPrivate")
|
||||
}
|
||||
let aciIdentityKeyPrivate = proto.aciIdentityKeyPrivate
|
||||
|
||||
guard proto.hasPniIdentityKeyPublic else {
|
||||
throw ProvisioningProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: pniIdentityKeyPublic")
|
||||
throw ProvisioningProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: pniIdentityKeyPublic")
|
||||
}
|
||||
let pniIdentityKeyPublic = proto.pniIdentityKeyPublic
|
||||
|
||||
guard proto.hasPniIdentityKeyPrivate else {
|
||||
throw ProvisioningProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: pniIdentityKeyPrivate")
|
||||
throw ProvisioningProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: pniIdentityKeyPrivate")
|
||||
}
|
||||
let pniIdentityKeyPrivate = proto.pniIdentityKeyPrivate
|
||||
|
||||
guard proto.hasProvisioningCode else {
|
||||
throw ProvisioningProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: provisioningCode")
|
||||
throw ProvisioningProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: provisioningCode")
|
||||
}
|
||||
let provisioningCode = proto.provisioningCode
|
||||
|
||||
guard proto.hasProfileKey else {
|
||||
throw ProvisioningProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: profileKey")
|
||||
throw ProvisioningProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: profileKey")
|
||||
}
|
||||
let profileKey = proto.profileKey
|
||||
|
||||
|
||||
@@ -208,7 +208,7 @@ public class SSKProtoEnvelope: NSObject, Codable, NSSecureCoding {
|
||||
|
||||
fileprivate convenience init(_ proto: SignalServiceProtos_Envelope) throws {
|
||||
guard proto.hasTimestamp else {
|
||||
throw SSKProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: timestamp")
|
||||
throw SSKProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: timestamp")
|
||||
}
|
||||
let timestamp = proto.timestamp
|
||||
|
||||
@@ -529,7 +529,7 @@ public class SSKProtoTypingMessage: NSObject, Codable, NSSecureCoding {
|
||||
|
||||
fileprivate convenience init(_ proto: SignalServiceProtos_TypingMessage) throws {
|
||||
guard proto.hasTimestamp else {
|
||||
throw SSKProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: timestamp")
|
||||
throw SSKProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: timestamp")
|
||||
}
|
||||
let timestamp = proto.timestamp
|
||||
|
||||
@@ -1006,7 +1006,7 @@ public class SSKProtoPreview: NSObject, Codable, NSSecureCoding {
|
||||
|
||||
fileprivate convenience init(_ proto: SignalServiceProtos_Preview) throws {
|
||||
guard proto.hasURL else {
|
||||
throw SSKProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: url")
|
||||
throw SSKProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: url")
|
||||
}
|
||||
let url = proto.url
|
||||
|
||||
@@ -2206,7 +2206,7 @@ public class SSKProtoCallMessageOffer: NSObject, Codable, NSSecureCoding {
|
||||
|
||||
fileprivate convenience init(_ proto: SignalServiceProtos_CallMessage.Offer) throws {
|
||||
guard proto.hasID else {
|
||||
throw SSKProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: id")
|
||||
throw SSKProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: id")
|
||||
}
|
||||
let id = proto.id
|
||||
|
||||
@@ -2391,7 +2391,7 @@ public class SSKProtoCallMessageAnswer: NSObject, Codable, NSSecureCoding {
|
||||
|
||||
fileprivate convenience init(_ proto: SignalServiceProtos_CallMessage.Answer) throws {
|
||||
guard proto.hasID else {
|
||||
throw SSKProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: id")
|
||||
throw SSKProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: id")
|
||||
}
|
||||
let id = proto.id
|
||||
|
||||
@@ -2568,7 +2568,7 @@ public class SSKProtoCallMessageIceUpdate: NSObject, Codable, NSSecureCoding {
|
||||
|
||||
fileprivate convenience init(_ proto: SignalServiceProtos_CallMessage.IceUpdate) throws {
|
||||
guard proto.hasID else {
|
||||
throw SSKProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: id")
|
||||
throw SSKProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: id")
|
||||
}
|
||||
let id = proto.id
|
||||
|
||||
@@ -2733,7 +2733,7 @@ public class SSKProtoCallMessageBusy: NSObject, Codable, NSSecureCoding {
|
||||
|
||||
fileprivate convenience init(_ proto: SignalServiceProtos_CallMessage.Busy) throws {
|
||||
guard proto.hasID else {
|
||||
throw SSKProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: id")
|
||||
throw SSKProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: id")
|
||||
}
|
||||
let id = proto.id
|
||||
|
||||
@@ -2944,7 +2944,7 @@ public class SSKProtoCallMessageHangup: NSObject, Codable, NSSecureCoding {
|
||||
|
||||
fileprivate convenience init(_ proto: SignalServiceProtos_CallMessage.Hangup) throws {
|
||||
guard proto.hasID else {
|
||||
throw SSKProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: id")
|
||||
throw SSKProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: id")
|
||||
}
|
||||
let id = proto.id
|
||||
|
||||
@@ -3912,7 +3912,7 @@ public class SSKProtoDataMessageQuote: NSObject, Codable, NSSecureCoding {
|
||||
|
||||
fileprivate convenience init(_ proto: SignalServiceProtos_DataMessage.Quote) throws {
|
||||
guard proto.hasID else {
|
||||
throw SSKProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: id")
|
||||
throw SSKProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: id")
|
||||
}
|
||||
let id = proto.id
|
||||
|
||||
@@ -5709,22 +5709,22 @@ public class SSKProtoDataMessageSticker: NSObject, Codable, NSSecureCoding {
|
||||
|
||||
fileprivate convenience init(_ proto: SignalServiceProtos_DataMessage.Sticker) throws {
|
||||
guard proto.hasPackID else {
|
||||
throw SSKProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: packID")
|
||||
throw SSKProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: packID")
|
||||
}
|
||||
let packID = proto.packID
|
||||
|
||||
guard proto.hasPackKey else {
|
||||
throw SSKProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: packKey")
|
||||
throw SSKProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: packKey")
|
||||
}
|
||||
let packKey = proto.packKey
|
||||
|
||||
guard proto.hasStickerID else {
|
||||
throw SSKProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: stickerID")
|
||||
throw SSKProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: stickerID")
|
||||
}
|
||||
let stickerID = proto.stickerID
|
||||
|
||||
guard proto.hasData else {
|
||||
throw SSKProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: data")
|
||||
throw SSKProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: data")
|
||||
}
|
||||
let data = SSKProtoAttachmentPointer(proto.data)
|
||||
|
||||
@@ -5954,12 +5954,12 @@ public class SSKProtoDataMessageReaction: NSObject, Codable, NSSecureCoding {
|
||||
|
||||
fileprivate convenience init(_ proto: SignalServiceProtos_DataMessage.Reaction) throws {
|
||||
guard proto.hasEmoji else {
|
||||
throw SSKProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: emoji")
|
||||
throw SSKProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: emoji")
|
||||
}
|
||||
let emoji = proto.emoji
|
||||
|
||||
guard proto.hasTimestamp else {
|
||||
throw SSKProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: timestamp")
|
||||
throw SSKProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: timestamp")
|
||||
}
|
||||
let timestamp = proto.timestamp
|
||||
|
||||
@@ -6145,7 +6145,7 @@ public class SSKProtoDataMessageDelete: NSObject, Codable, NSSecureCoding {
|
||||
|
||||
fileprivate convenience init(_ proto: SignalServiceProtos_DataMessage.Delete) throws {
|
||||
guard proto.hasTargetSentTimestamp else {
|
||||
throw SSKProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: targetSentTimestamp")
|
||||
throw SSKProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: targetSentTimestamp")
|
||||
}
|
||||
let targetSentTimestamp = proto.targetSentTimestamp
|
||||
|
||||
@@ -6450,7 +6450,7 @@ public class SSKProtoDataMessagePaymentAmountMobileCoin: NSObject, Codable, NSSe
|
||||
|
||||
fileprivate convenience init(_ proto: SignalServiceProtos_DataMessage.Payment.Amount.MobileCoin) throws {
|
||||
guard proto.hasPicoMob else {
|
||||
throw SSKProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: picoMob")
|
||||
throw SSKProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: picoMob")
|
||||
}
|
||||
let picoMob = proto.picoMob
|
||||
|
||||
@@ -6754,7 +6754,7 @@ public class SSKProtoDataMessagePaymentNotificationMobileCoin: NSObject, Codable
|
||||
|
||||
fileprivate convenience init(_ proto: SignalServiceProtos_DataMessage.Payment.Notification.MobileCoin) throws {
|
||||
guard proto.hasReceipt else {
|
||||
throw SSKProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: receipt")
|
||||
throw SSKProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: receipt")
|
||||
}
|
||||
let receipt = proto.receipt
|
||||
|
||||
@@ -9746,7 +9746,7 @@ public class SSKProtoSyncMessageContacts: NSObject, Codable, NSSecureCoding {
|
||||
|
||||
fileprivate convenience init(_ proto: SignalServiceProtos_SyncMessage.Contacts) throws {
|
||||
guard proto.hasBlob else {
|
||||
throw SSKProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: blob")
|
||||
throw SSKProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: blob")
|
||||
}
|
||||
let blob = SSKProtoAttachmentPointer(proto.blob)
|
||||
|
||||
@@ -10286,7 +10286,7 @@ public class SSKProtoSyncMessageRead: NSObject, Codable, NSSecureCoding {
|
||||
|
||||
fileprivate convenience init(_ proto: SignalServiceProtos_SyncMessage.Read) throws {
|
||||
guard proto.hasTimestamp else {
|
||||
throw SSKProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: timestamp")
|
||||
throw SSKProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: timestamp")
|
||||
}
|
||||
let timestamp = proto.timestamp
|
||||
|
||||
@@ -10463,7 +10463,7 @@ public class SSKProtoSyncMessageViewed: NSObject, Codable, NSSecureCoding {
|
||||
|
||||
fileprivate convenience init(_ proto: SignalServiceProtos_SyncMessage.Viewed) throws {
|
||||
guard proto.hasTimestamp else {
|
||||
throw SSKProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: timestamp")
|
||||
throw SSKProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: timestamp")
|
||||
}
|
||||
let timestamp = proto.timestamp
|
||||
|
||||
@@ -10888,12 +10888,12 @@ public class SSKProtoSyncMessageStickerPackOperation: NSObject, Codable, NSSecur
|
||||
|
||||
fileprivate convenience init(_ proto: SignalServiceProtos_SyncMessage.StickerPackOperation) throws {
|
||||
guard proto.hasPackID else {
|
||||
throw SSKProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: packID")
|
||||
throw SSKProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: packID")
|
||||
}
|
||||
let packID = proto.packID
|
||||
|
||||
guard proto.hasPackKey else {
|
||||
throw SSKProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: packKey")
|
||||
throw SSKProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: packKey")
|
||||
}
|
||||
let packKey = proto.packKey
|
||||
|
||||
@@ -11083,7 +11083,7 @@ public class SSKProtoSyncMessageViewOnceOpen: NSObject, Codable, NSSecureCoding
|
||||
|
||||
fileprivate convenience init(_ proto: SignalServiceProtos_SyncMessage.ViewOnceOpen) throws {
|
||||
guard proto.hasTimestamp else {
|
||||
throw SSKProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: timestamp")
|
||||
throw SSKProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: timestamp")
|
||||
}
|
||||
let timestamp = proto.timestamp
|
||||
|
||||
@@ -11936,17 +11936,17 @@ public class SSKProtoSyncMessageOutgoingPaymentMobileCoin: NSObject, Codable, NS
|
||||
|
||||
fileprivate convenience init(_ proto: SignalServiceProtos_SyncMessage.OutgoingPayment.MobileCoin) throws {
|
||||
guard proto.hasAmountPicoMob else {
|
||||
throw SSKProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: amountPicoMob")
|
||||
throw SSKProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: amountPicoMob")
|
||||
}
|
||||
let amountPicoMob = proto.amountPicoMob
|
||||
|
||||
guard proto.hasFeePicoMob else {
|
||||
throw SSKProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: feePicoMob")
|
||||
throw SSKProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: feePicoMob")
|
||||
}
|
||||
let feePicoMob = proto.feePicoMob
|
||||
|
||||
guard proto.hasLedgerBlockIndex else {
|
||||
throw SSKProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: ledgerBlockIndex")
|
||||
throw SSKProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: ledgerBlockIndex")
|
||||
}
|
||||
let ledgerBlockIndex = proto.ledgerBlockIndex
|
||||
|
||||
@@ -16817,7 +16817,7 @@ public class SSKProtoPackSticker: NSObject, Codable, NSSecureCoding {
|
||||
|
||||
fileprivate convenience init(_ proto: SignalServiceProtos_Pack.Sticker) throws {
|
||||
guard proto.hasID else {
|
||||
throw SSKProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: id")
|
||||
throw SSKProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: id")
|
||||
}
|
||||
let id = proto.id
|
||||
|
||||
@@ -17226,12 +17226,12 @@ public class SSKProtoPaymentAddressMobileCoin: NSObject, Codable, NSSecureCoding
|
||||
|
||||
fileprivate convenience init(_ proto: SignalServiceProtos_PaymentAddress.MobileCoin) throws {
|
||||
guard proto.hasPublicAddress else {
|
||||
throw SSKProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: publicAddress")
|
||||
throw SSKProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: publicAddress")
|
||||
}
|
||||
let publicAddress = proto.publicAddress
|
||||
|
||||
guard proto.hasSignature else {
|
||||
throw SSKProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: signature")
|
||||
throw SSKProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: signature")
|
||||
}
|
||||
let signature = proto.signature
|
||||
|
||||
|
||||
@@ -59,17 +59,17 @@ public class SignalIOSProtoDeviceName: NSObject, Codable, NSSecureCoding {
|
||||
|
||||
fileprivate convenience init(_ proto: IOSProtos_DeviceName) throws {
|
||||
guard proto.hasEphemeralPublic else {
|
||||
throw SignalIOSProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: ephemeralPublic")
|
||||
throw SignalIOSProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: ephemeralPublic")
|
||||
}
|
||||
let ephemeralPublic = proto.ephemeralPublic
|
||||
|
||||
guard proto.hasSyntheticIv else {
|
||||
throw SignalIOSProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: syntheticIv")
|
||||
throw SignalIOSProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: syntheticIv")
|
||||
}
|
||||
let syntheticIv = proto.syntheticIv
|
||||
|
||||
guard proto.hasCiphertext else {
|
||||
throw SignalIOSProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: ciphertext")
|
||||
throw SignalIOSProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: ciphertext")
|
||||
}
|
||||
let ciphertext = proto.ciphertext
|
||||
|
||||
|
||||
@@ -76,17 +76,17 @@ public class WebSocketProtoWebSocketRequestMessage: NSObject, Codable, NSSecureC
|
||||
|
||||
fileprivate convenience init(_ proto: WebSocketProtos_WebSocketRequestMessage) throws {
|
||||
guard proto.hasVerb else {
|
||||
throw WebSocketProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: verb")
|
||||
throw WebSocketProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: verb")
|
||||
}
|
||||
let verb = proto.verb
|
||||
|
||||
guard proto.hasPath else {
|
||||
throw WebSocketProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: path")
|
||||
throw WebSocketProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: path")
|
||||
}
|
||||
let path = proto.path
|
||||
|
||||
guard proto.hasRequestID else {
|
||||
throw WebSocketProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: requestID")
|
||||
throw WebSocketProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: requestID")
|
||||
}
|
||||
let requestID = proto.requestID
|
||||
|
||||
@@ -322,12 +322,12 @@ public class WebSocketProtoWebSocketResponseMessage: NSObject, Codable, NSSecure
|
||||
|
||||
fileprivate convenience init(_ proto: WebSocketProtos_WebSocketResponseMessage) throws {
|
||||
guard proto.hasRequestID else {
|
||||
throw WebSocketProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: requestID")
|
||||
throw WebSocketProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: requestID")
|
||||
}
|
||||
let requestID = proto.requestID
|
||||
|
||||
guard proto.hasStatus else {
|
||||
throw WebSocketProtoError.invalidProtobuf(description: "\(Self.logTag()) missing required field: status")
|
||||
throw WebSocketProtoError.invalidProtobuf(description: "[\(Self.self)] missing required field: status")
|
||||
}
|
||||
let status = proto.status
|
||||
|
||||
|
||||
@@ -9,6 +9,5 @@
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import <SignalServiceKit/NSObject+OWS.h>
|
||||
#import <SignalServiceKit/OWSAsserts.h>
|
||||
#endif
|
||||
|
||||
@@ -16,7 +16,6 @@ FOUNDATION_EXPORT const unsigned char SignalServiceKitVersionString[];
|
||||
#import <SignalServiceKit/IncomingGroupsV2MessageJob.h>
|
||||
#import <SignalServiceKit/InstalledSticker.h>
|
||||
#import <SignalServiceKit/NSDate+OWS.h>
|
||||
#import <SignalServiceKit/NSObject+OWS.h>
|
||||
#import <SignalServiceKit/OWSAddToContactsOfferMessage.h>
|
||||
#import <SignalServiceKit/OWSAddToProfileWhitelistOfferMessage.h>
|
||||
#import <SignalServiceKit/OWSArchivedPaymentMessage.h>
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
//
|
||||
// Copyright 2024 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
//
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface NSObject (OWS)
|
||||
|
||||
#pragma mark - Logging
|
||||
|
||||
@property (nonatomic, readonly) NSString *logTag;
|
||||
|
||||
@property (class, nonatomic, readonly) NSString *logTag;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -1,26 +0,0 @@
|
||||
//
|
||||
// Copyright 2024 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
//
|
||||
|
||||
#import "NSObject+OWS.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@implementation NSObject (OWS)
|
||||
|
||||
#pragma mark - Logging
|
||||
|
||||
+ (NSString *)logTag
|
||||
{
|
||||
return [NSString stringWithFormat:@"[%@]", self.class];
|
||||
}
|
||||
|
||||
- (NSString *)logTag
|
||||
{
|
||||
return self.class.logTag;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -91,7 +91,7 @@ public class AudioPlayer: NSObject {
|
||||
|
||||
private init(source: Source, audioBehavior: AudioBehavior) {
|
||||
self.source = source
|
||||
audioActivity = AudioActivity(audioDescription: "\(Self.logTag()) \(source.description)", behavior: audioBehavior)
|
||||
audioActivity = AudioActivity(audioDescription: "[\(Self.self)] \(source.description)", behavior: audioBehavior)
|
||||
|
||||
super.init()
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ public class GroupTableViewCell: UITableViewCell {
|
||||
var customAccessoryView: UIView?
|
||||
|
||||
public init() {
|
||||
super.init(style: .default, reuseIdentifier: GroupTableViewCell.logTag())
|
||||
super.init(style: .default, reuseIdentifier: "[\(Self.self)]")
|
||||
|
||||
// Font config
|
||||
nameLabel.font = .dynamicTypeBody
|
||||
|
||||
@@ -103,7 +103,7 @@ class FingerprintScanViewController: OWSViewController, OWSNavigationChildContro
|
||||
identityKey: identityKey,
|
||||
recipientAci: recipientAci,
|
||||
contactName: contactName,
|
||||
tag: logTag
|
||||
tag: "[\(type(of: self))]"
|
||||
)
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ class FingerprintScanViewController: OWSViewController, OWSNavigationChildContro
|
||||
localizedErrorDescription: localizedErrorDescription,
|
||||
retry: { self.qrCodeScanViewController.tryToStartScanning() },
|
||||
cancel: { self.navigationController?.popViewController(animated: true) },
|
||||
tag: logTag
|
||||
tag: "[\(type(of: self))]"
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -472,7 +472,7 @@ extension FingerprintViewController: CompareSafetyNumbersActivityDelegate {
|
||||
identityKey: identityKey,
|
||||
recipientAci: recipientAci,
|
||||
contactName: fingerprint.theirName,
|
||||
tag: logTag
|
||||
tag: "[\(type(of: self))]"
|
||||
)
|
||||
}
|
||||
|
||||
@@ -483,7 +483,7 @@ extension FingerprintViewController: CompareSafetyNumbersActivityDelegate {
|
||||
from: self,
|
||||
isUserError: isUserError,
|
||||
localizedErrorDescription: error.userErrorDescription,
|
||||
tag: logTag
|
||||
tag: "[\(type(of: self))]"
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user