diff --git a/Scripts/LintLocalizableStrings.swift b/Scripts/LintLocalizableStrings.swift index a4d904a60..e943e0f03 100755 --- a/Scripts/LintLocalizableStrings.swift +++ b/Scripts/LintLocalizableStrings.swift @@ -27,7 +27,7 @@ extension ProjectState { "_SharedTestUtilities/", // Exclude shared test directory "external/" // External dependencies ] - static let excludedPhrases: Set = [ "", " ", " ", ",", ", ", "null", "\"", "@[0-9a-fA-F]{66}", "^[0-9A-Fa-f]+$" ] + static let excludedPhrases: Set = [ "", " ", " ", ",", ", ", "null", "\"", "@[0-9a-fA-F]{66}", "^[0-9A-Fa-f]+$", "/" ] static let excludedUnlocalisedStringLineMatching: Set = [ .contains(ProjectState.lintSuppression, caseSensitive: false), .prefix("#import", caseSensitive: false), @@ -82,6 +82,7 @@ extension ProjectState { .contains("accessibilityId:", caseSensitive: false), .contains("key:", caseSensitive: false), .contains("separator:", caseSensitive: false), + .contains("separatedBy:", caseSensitive: false), .nextLine(.contains(".put(key:", caseSensitive: false)), .nextLine(.contains(".localized()", caseSensitive: false)), .regex(".*static var databaseTableName: String"), diff --git a/SessionMessagingKit/Calls/TurnServerInfo.swift b/SessionMessagingKit/Calls/TurnServerInfo.swift index 50420ca97..5baf52ccc 100644 --- a/SessionMessagingKit/Calls/TurnServerInfo.swift +++ b/SessionMessagingKit/Calls/TurnServerInfo.swift @@ -1,5 +1,7 @@ // Copyright © 2021 Rangeproof Pty Ltd. All rights reserved. +// stringlint:disable + import Foundation import SessionUtilitiesKit diff --git a/SessionMessagingKit/Calls/WebRTC+Utilities.swift b/SessionMessagingKit/Calls/WebRTC+Utilities.swift index 2bdd847dd..169a90edb 100644 --- a/SessionMessagingKit/Calls/WebRTC+Utilities.swift +++ b/SessionMessagingKit/Calls/WebRTC+Utilities.swift @@ -1,3 +1,5 @@ +// stringlint:disable + import WebRTC extension RTCSignalingState : CustomStringConvertible { diff --git a/SessionMessagingKit/Calls/WebRTCSession+DataChannel.swift b/SessionMessagingKit/Calls/WebRTCSession+DataChannel.swift index 991e76573..d8c81b7a6 100644 --- a/SessionMessagingKit/Calls/WebRTCSession+DataChannel.swift +++ b/SessionMessagingKit/Calls/WebRTCSession+DataChannel.swift @@ -12,7 +12,7 @@ extension WebRTCSession: RTCDataChannelDelegate { dataChannelConfiguration.isOrdered = true dataChannelConfiguration.isNegotiated = true dataChannelConfiguration.channelId = 548 - guard let dataChannel = peerConnection?.dataChannel(forLabel: "CONTROL", configuration: dataChannelConfiguration) else { + guard let dataChannel = peerConnection?.dataChannel(forLabel: "CONTROL", configuration: dataChannelConfiguration) else { // stringlint:disable SNLog("[Calls] Couldn't create data channel.") return nil } @@ -38,10 +38,10 @@ extension WebRTCSession: RTCDataChannelDelegate { public func dataChannel(_ dataChannel: RTCDataChannel, didReceiveMessageWith buffer: RTCDataBuffer) { if let json = try? JSONSerialization.jsonObject(with: buffer.data, options: [ .fragmentsAllowed ]) as? JSON { SNLog("[Calls] Data channel did receive data: \(json)") - if let isRemoteVideoEnabled = json["video"] as? Bool { + if let isRemoteVideoEnabled = json["video"] as? Bool { // stringlint:disable delegate?.isRemoteVideoDidChange(isEnabled: isRemoteVideoEnabled) } - if let _ = json["hangup"] { + if let _ = json["hangup"] { // stringlint:disable delegate?.didReceiveHangUpSignal() } } diff --git a/SessionMessagingKit/Calls/WebRTCSession.swift b/SessionMessagingKit/Calls/WebRTCSession.swift index 7a8ff1a58..26c97d455 100644 --- a/SessionMessagingKit/Calls/WebRTCSession.swift +++ b/SessionMessagingKit/Calls/WebRTCSession.swift @@ -58,7 +58,7 @@ public final class WebRTCSession : NSObject, RTCPeerConnectionDelegate { }() internal lazy var audioTrack: RTCAudioTrack = { - return factory.audioTrack(with: audioSource, trackId: "ARDAMSa0") + return factory.audioTrack(with: audioSource, trackId: "ARDAMSa0") // stringlint:disable }() // Video @@ -69,7 +69,7 @@ public final class WebRTCSession : NSObject, RTCPeerConnectionDelegate { }() internal lazy var localVideoTrack: RTCVideoTrack = { - return factory.videoTrack(with: localVideoSource, trackId: "ARDAMSv0") + return factory.videoTrack(with: localVideoSource, trackId: "ARDAMSv0") // stringlint:disable }() internal lazy var remoteVideoTrack: RTCVideoTrack? = { @@ -86,7 +86,7 @@ public final class WebRTCSession : NSObject, RTCPeerConnectionDelegate { public var errorDescription: String? { switch self { - case .noThread: return "Couldn't find thread for contact." + case .noThread: return "Couldn't find thread for contact." // stringlint:disable } } } @@ -103,7 +103,7 @@ public final class WebRTCSession : NSObject, RTCPeerConnectionDelegate { super.init() - let mediaStreamTrackIDS = ["ARDAMS"] + let mediaStreamTrackIDS = ["ARDAMS"] // stringlint:disable peerConnection?.add(audioTrack, streamIds: mediaStreamTrackIDS) peerConnection?.add(localVideoTrack, streamIds: mediaStreamTrackIDS) @@ -394,8 +394,8 @@ public final class WebRTCSession : NSObject, RTCPeerConnectionDelegate { private func correctSessionDescription(sdp: RTCSessionDescription?) -> RTCSessionDescription? { guard let sdp = sdp else { return nil } - let cbrSdp = sdp.sdp.description.replace(regex: "(a=fmtp:111 ((?!cbr=).)*)\r?\n", with: "$1;cbr=1\r\n") - let finalSdp = cbrSdp.replace(regex: ".+urn:ietf:params:rtp-hdrext:ssrc-audio-level.*\r?\n", with: "") + let cbrSdp = sdp.sdp.description.replace(regex: "(a=fmtp:111 ((?!cbr=).)*)\r?\n", with: "$1;cbr=1\r\n") // stringlint:disable + let finalSdp = cbrSdp.replace(regex: ".+urn:ietf:params:rtp-hdrext:ssrc-audio-level.*\r?\n", with: "") // stringlint:disable return RTCSessionDescription(type: sdp.type, sdp: finalSdp) } @@ -480,15 +480,15 @@ extension WebRTCSession { public func turnOffVideo() { localVideoTrack.isEnabled = false - sendJSON(["video": false]) + sendJSON(["video": false]) // stringlint:disable } public func turnOnVideo() { localVideoTrack.isEnabled = true - sendJSON(["video": true]) + sendJSON(["video": true]) // stringlint:disable } public func hangUp() { - sendJSON(["hangup": true]) + sendJSON(["hangup": true]) // stringlint:disable } } diff --git a/SessionMessagingKit/Database/Models/Attachment.swift b/SessionMessagingKit/Database/Models/Attachment.swift index 385018e14..1b031c536 100644 --- a/SessionMessagingKit/Database/Models/Attachment.swift +++ b/SessionMessagingKit/Database/Models/Attachment.swift @@ -604,7 +604,7 @@ extension Attachment { private static var sharedDataAttachmentsDirPath: String = { URL(fileURLWithPath: OWSFileSystem.appSharedDataDirectoryPath()) - .appendingPathComponent("Attachments") + .appendingPathComponent("Attachments") // stringlint:disable .path }() @@ -720,7 +720,7 @@ extension Attachment { // MARK: - Convenience extension Attachment { - public static let nonMediaQuoteFileId: String = "NON_MEDIA_QUOTE_FILE_ID" + public static let nonMediaQuoteFileId: String = "NON_MEDIA_QUOTE_FILE_ID" // stringlint:disable public enum ThumbnailSize { case small @@ -753,7 +753,7 @@ extension Attachment { var thumbnailsDirPath: String { // Thumbnails are written to the caches directory, so that iOS can // remove them if necessary - return "\(OWSFileSystem.cachesDirectoryPath())/\(id)-thumbnails" + return "\(OWSFileSystem.cachesDirectoryPath())/\(id)-thumbnails" // stringlint:disable } var legacyThumbnailPath: String? { @@ -766,7 +766,7 @@ extension Attachment { let filename: String = fileUrl.lastPathComponent.filenameWithoutExtension let containingDir: String = fileUrl.deletingLastPathComponent().path - return "\(containingDir)/\(filename)-signal-ios-thumbnail.jpg" + return "\(containingDir)/\(filename)-signal-ios-thumbnail.jpg" // stringlint:disable } var originalImage: UIImage? { @@ -822,7 +822,7 @@ extension Attachment { } public func thumbnailPath(for dimensions: UInt) -> String { - return "\(thumbnailsDirPath)/thumbnail-\(dimensions).jpg" + return "\(thumbnailsDirPath)/thumbnail-\(dimensions).jpg" // stringlint:disable } private func loadThumbnail(with dimensions: UInt, success: @escaping (UIImage, () throws -> Data) -> (), failure: @escaping () -> ()) { @@ -900,7 +900,7 @@ extension Attachment { public func cloneAsQuoteThumbnail() -> Attachment? { let cloneId: String = UUID().uuidString - let thumbnailName: String = "quoted-thumbnail-\(sourceFilename ?? "null")" + let thumbnailName: String = "quoted-thumbnail-\(sourceFilename ?? "null")" // stringlint:disable guard self.isVisualMedia else { return nil } diff --git a/SessionMessagingKit/Database/Models/Capability.swift b/SessionMessagingKit/Database/Models/Capability.swift index 304bc8813..b10522203 100644 --- a/SessionMessagingKit/Database/Models/Capability.swift +++ b/SessionMessagingKit/Database/Models/Capability.swift @@ -1,5 +1,7 @@ // Copyright © 2022 Rangeproof Pty Ltd. All rights reserved. +// stringlint:disable + import Foundation import GRDB import SessionUtilitiesKit diff --git a/SessionMessagingKit/Database/Models/Interaction.swift b/SessionMessagingKit/Database/Models/Interaction.swift index e863e8f56..22122906e 100644 --- a/SessionMessagingKit/Database/Models/Interaction.swift +++ b/SessionMessagingKit/Database/Models/Interaction.swift @@ -35,7 +35,7 @@ public struct Interaction: Codable, Identifiable, Equatable, FetchableRecord, Mu ) -> SQL { let halfResolution: Double = LinkPreview.timstampResolution - return "(\(interaction[.timestampMs]) BETWEEN (\(linkPreview[.timestamp]) - \(halfResolution)) * 1000 AND (\(linkPreview[.timestamp]) + \(halfResolution)) * 1000)" + return "(\(interaction[.timestampMs]) BETWEEN (\(linkPreview[.timestamp]) - \(halfResolution)) * 1000 AND (\(linkPreview[.timestamp]) + \(halfResolution)) * 1000)" // stringlint:disable } public static let recipientStates = hasMany(RecipientState.self, using: RecipientState.interactionForeignKey) @@ -936,7 +936,7 @@ public extension Interaction { return publicKeysToCheck.contains { publicKey in ( body != nil && - (body ?? "").contains("@\(publicKey)") + (body ?? "").contains("@\(publicKey)") // stringlint:disable ) || ( quoteAuthorId == publicKey ) diff --git a/SessionMessagingKit/Database/Models/LinkPreview.swift b/SessionMessagingKit/Database/Models/LinkPreview.swift index b721fac39..301547b2a 100644 --- a/SessionMessagingKit/Database/Models/LinkPreview.swift +++ b/SessionMessagingKit/Database/Models/LinkPreview.swift @@ -1,5 +1,7 @@ // Copyright © 2022 Rangeproof Pty Ltd. All rights reserved. +// stringlint:disable + import Foundation import Combine import GRDB diff --git a/SessionMessagingKit/File Server/FileServerAPI.swift b/SessionMessagingKit/File Server/FileServerAPI.swift index 73c1ccead..de0dff5b1 100644 --- a/SessionMessagingKit/File Server/FileServerAPI.swift +++ b/SessionMessagingKit/File Server/FileServerAPI.swift @@ -1,5 +1,7 @@ // Copyright © 2022 Rangeproof Pty Ltd. All rights reserved. +// stringlint:disable + import Foundation import Combine import SessionSnodeKit diff --git a/SessionMessagingKit/File Server/Types/FSEndpoint.swift b/SessionMessagingKit/File Server/Types/FSEndpoint.swift index edc555f4f..7edd69e3c 100644 --- a/SessionMessagingKit/File Server/Types/FSEndpoint.swift +++ b/SessionMessagingKit/File Server/Types/FSEndpoint.swift @@ -1,5 +1,7 @@ // Copyright © 2022 Rangeproof Pty Ltd. All rights reserved. +// stringlint:disable + import Foundation import SessionUtilitiesKit diff --git a/SessionMessagingKit/Jobs/Types/AttachmentDownloadJob.swift b/SessionMessagingKit/Jobs/Types/AttachmentDownloadJob.swift index 146430ec3..0e0e1e3ff 100644 --- a/SessionMessagingKit/Jobs/Types/AttachmentDownloadJob.swift +++ b/SessionMessagingKit/Jobs/Types/AttachmentDownloadJob.swift @@ -241,8 +241,8 @@ extension AttachmentDownloadJob { public var errorDescription: String? { switch self { - case .failedToSaveFile: return "Failed to save file" - case .invalidUrl: return "Invalid file URL" + case .failedToSaveFile: return "Failed to save file" // stringlint:disable + case .invalidUrl: return "Invalid file URL" // stringlint:disable } } } diff --git a/SessionMessagingKit/Messages/Control Messages/CallMessage.swift b/SessionMessagingKit/Messages/Control Messages/CallMessage.swift index 794034936..9a03e8f25 100644 --- a/SessionMessagingKit/Messages/Control Messages/CallMessage.swift +++ b/SessionMessagingKit/Messages/Control Messages/CallMessage.swift @@ -45,12 +45,12 @@ public final class CallMessage: ControlMessage { public var description: String { switch self { - case .preOffer: return "preOffer" - case .offer: return "offer" - case .answer: return "answer" - case .provisionalAnswer: return "provisionalAnswer" - case .iceCandidates(_, _): return "iceCandidates" - case .endCall: return "endCall" + case .preOffer: return "preOffer" // stringlint:disable + case .offer: return "offer" // stringlint:disable + case .answer: return "answer" // stringlint:disable + case .provisionalAnswer: return "provisionalAnswer" // stringlint:disable + case .iceCandidates(_, _): return "iceCandidates" // stringlint:disable + case .endCall: return "endCall" // stringlint:disable } } diff --git a/SessionMessagingKit/Messages/Control Messages/ClosedGroupControlMessage.swift b/SessionMessagingKit/Messages/Control Messages/ClosedGroupControlMessage.swift index cf164b249..5b01cfe29 100644 --- a/SessionMessagingKit/Messages/Control Messages/ClosedGroupControlMessage.swift +++ b/SessionMessagingKit/Messages/Control Messages/ClosedGroupControlMessage.swift @@ -50,13 +50,13 @@ public final class ClosedGroupControlMessage: ControlMessage { public var description: String { switch self { - case .new: return "new" - case .encryptionKeyPair: return "encryptionKeyPair" - case .nameChange: return "nameChange" - case .membersAdded: return "membersAdded" - case .membersRemoved: return "membersRemoved" - case .memberLeft: return "memberLeft" - case .encryptionKeyPairRequest: return "encryptionKeyPairRequest" + case .new: return "new" // stringlint:disable + case .encryptionKeyPair: return "encryptionKeyPair" // stringlint:disable + case .nameChange: return "nameChange" // stringlint:disable + case .membersAdded: return "membersAdded" // stringlint:disable + case .membersRemoved: return "membersRemoved" // stringlint:disable + case .memberLeft: return "memberLeft" // stringlint:disable + case .encryptionKeyPairRequest: return "encryptionKeyPairRequest" // stringlint:disable } } diff --git a/SessionMessagingKit/Messages/Control Messages/DataExtractionNotification.swift b/SessionMessagingKit/Messages/Control Messages/DataExtractionNotification.swift index 331ce7fa9..2e11376d7 100644 --- a/SessionMessagingKit/Messages/Control Messages/DataExtractionNotification.swift +++ b/SessionMessagingKit/Messages/Control Messages/DataExtractionNotification.swift @@ -19,8 +19,8 @@ public final class DataExtractionNotification: ControlMessage { public var description: String { switch self { - case .screenshot: return "screenshot" - case .mediaSaved: return "mediaSaved" + case .screenshot: return "screenshot" // stringlint:disable + case .mediaSaved: return "mediaSaved" // stringlint:disable } } } diff --git a/SessionMessagingKit/Messages/Control Messages/SharedConfigMessage.swift b/SessionMessagingKit/Messages/Control Messages/SharedConfigMessage.swift index 7182ef843..515f4f37c 100644 --- a/SessionMessagingKit/Messages/Control Messages/SharedConfigMessage.swift +++ b/SessionMessagingKit/Messages/Control Messages/SharedConfigMessage.swift @@ -29,10 +29,10 @@ public final class SharedConfigMessage: ControlMessage { public var description: String { switch self { - case .userProfile: return "userProfile" - case .contacts: return "contacts" - case .convoInfoVolatile: return "convoInfoVolatile" - case .userGroups: return "userGroups" + case .userProfile: return "userProfile" // stringlint:disable + case .contacts: return "contacts" // stringlint:disable + case .convoInfoVolatile: return "convoInfoVolatile" // stringlint:disable + case .userGroups: return "userGroups" // stringlint:disable } } } diff --git a/SessionMessagingKit/Messages/Control Messages/TypingIndicator.swift b/SessionMessagingKit/Messages/Control Messages/TypingIndicator.swift index 2d131d069..9968e0224 100644 --- a/SessionMessagingKit/Messages/Control Messages/TypingIndicator.swift +++ b/SessionMessagingKit/Messages/Control Messages/TypingIndicator.swift @@ -34,8 +34,8 @@ public final class TypingIndicator: ControlMessage { public var description: String { switch self { - case .started: return "started" - case .stopped: return "stopped" + case .started: return "started" // stringlint:disable + case .stopped: return "stopped" // stringlint:disable } } } diff --git a/SessionMessagingKit/Messages/Visible Messages/VisibleMessage+Reaction.swift b/SessionMessagingKit/Messages/Visible Messages/VisibleMessage+Reaction.swift index 21c53ba9e..205cef3b9 100644 --- a/SessionMessagingKit/Messages/Visible Messages/VisibleMessage+Reaction.swift +++ b/SessionMessagingKit/Messages/Visible Messages/VisibleMessage+Reaction.swift @@ -28,8 +28,8 @@ public extension VisibleMessage { var description: String { switch self { - case .react: return "react" - case .remove: return "remove" + case .react: return "react" // stringlint:disable + case .remove: return "remove" // stringlint:disable } } diff --git a/SessionMessagingKit/Open Groups/OpenGroupManager.swift b/SessionMessagingKit/Open Groups/OpenGroupManager.swift index a023ab5f7..bd60a1665 100644 --- a/SessionMessagingKit/Open Groups/OpenGroupManager.swift +++ b/SessionMessagingKit/Open Groups/OpenGroupManager.swift @@ -66,7 +66,7 @@ public final class OpenGroupManager { private static func port(for server: String, serverUrl: URL) -> String { if let port: Int = serverUrl.port { - return ":\(port)" + return ":\(port)" // stringlint:disable } let components: [String] = server.components(separatedBy: ":") @@ -79,7 +79,7 @@ public final class OpenGroupManager { ) else { return "" } - return ":\(port)" + return ":\(port)" // stringlint:disable } public static func isSessionRunOpenGroup(server: String) -> Bool { diff --git a/SessionMessagingKit/Open Groups/Types/HTTPQueryParam+OpenGroup.swift b/SessionMessagingKit/Open Groups/Types/HTTPQueryParam+OpenGroup.swift index eac835a7f..cfcda864d 100644 --- a/SessionMessagingKit/Open Groups/Types/HTTPQueryParam+OpenGroup.swift +++ b/SessionMessagingKit/Open Groups/Types/HTTPQueryParam+OpenGroup.swift @@ -1,5 +1,7 @@ // Copyright © 2022 Rangeproof Pty Ltd. All rights reserved. +// stringlint:disable + import Foundation import SessionUtilitiesKit diff --git a/SessionMessagingKit/Open Groups/Types/OpenGroupAPIError.swift b/SessionMessagingKit/Open Groups/Types/OpenGroupAPIError.swift index e1a8945da..88237785e 100644 --- a/SessionMessagingKit/Open Groups/Types/OpenGroupAPIError.swift +++ b/SessionMessagingKit/Open Groups/Types/OpenGroupAPIError.swift @@ -1,5 +1,7 @@ // Copyright © 2022 Rangeproof Pty Ltd. All rights reserved. +// stringlint:disable + import Foundation public enum OpenGroupAPIError: LocalizedError { diff --git a/SessionMessagingKit/Sending & Receiving/Attachments/SignalAttachment.swift b/SessionMessagingKit/Sending & Receiving/Attachments/SignalAttachment.swift index b5305684b..f6b54acc5 100644 --- a/SessionMessagingKit/Sending & Receiving/Attachments/SignalAttachment.swift +++ b/SessionMessagingKit/Sending & Receiving/Attachments/SignalAttachment.swift @@ -286,16 +286,6 @@ public class SignalAttachment: Equatable, Hashable { // Returns the MIME type for this attachment or nil if no MIME type // can be identified. public var mimeType: String { - if isVoiceMessage { - // Legacy iOS clients don't handle "audio/mp4" files correctly; - // they are written to disk as .mp4 instead of .m4a which breaks - // playback. So we send voice messages as "audio/aac" to work - // around this. - // - // TODO: Remove this Nov. 2016 or after. - return "audio/aac" - } - if let filename = sourceFilename { let fileExtension = (filename as NSString).pathExtension if fileExtension.count > 0 { diff --git a/SessionMessagingKit/Sending & Receiving/Errors/AttachmentError.swift b/SessionMessagingKit/Sending & Receiving/Errors/AttachmentError.swift index 5f708431e..23f750b05 100644 --- a/SessionMessagingKit/Sending & Receiving/Errors/AttachmentError.swift +++ b/SessionMessagingKit/Sending & Receiving/Errors/AttachmentError.swift @@ -1,5 +1,7 @@ // Copyright © 2022 Rangeproof Pty Ltd. All rights reserved. +// stringlint:disable + import Foundation public enum AttachmentError: LocalizedError { diff --git a/SessionMessagingKit/Sending & Receiving/Message Handling/MessageSender+ClosedGroups.swift b/SessionMessagingKit/Sending & Receiving/Message Handling/MessageSender+ClosedGroups.swift index c582fe56d..5d733c1a9 100644 --- a/SessionMessagingKit/Sending & Receiving/Message Handling/MessageSender+ClosedGroups.swift +++ b/SessionMessagingKit/Sending & Receiving/Message Handling/MessageSender+ClosedGroups.swift @@ -110,7 +110,7 @@ extension MessageSender { } let allActiveLegacyGroupIds: Set = try ClosedGroup .select(.threadId) - .filter(!ClosedGroup.Columns.threadId.like("\(SessionId.Prefix.group.rawValue)%")) + .filter(!ClosedGroup.Columns.threadId.like("\(SessionId.Prefix.group.rawValue)%")) // stringlint:disable .joining( required: ClosedGroup.members .filter(GroupMember.Columns.profileId == userPublicKey) diff --git a/SessionMessagingKit/Sending & Receiving/Notifications/Models/SubscribeRequest.swift b/SessionMessagingKit/Sending & Receiving/Notifications/Models/SubscribeRequest.swift index 9417d232d..1635bdc34 100644 --- a/SessionMessagingKit/Sending & Receiving/Notifications/Models/SubscribeRequest.swift +++ b/SessionMessagingKit/Sending & Receiving/Notifications/Models/SubscribeRequest.swift @@ -124,10 +124,10 @@ extension PushNotificationAPI { /// on whether the subscription wants message data included; and the trailing `NS[i]` values are a /// comma-delimited list of namespaces that should be subscribed to, in the same sorted order as /// the `namespaces` parameter. - let verificationBytes: [UInt8] = "MONITOR".bytes + let verificationBytes: [UInt8] = "MONITOR".bytes // stringlint:disable .appending(contentsOf: pubkey.bytes) .appending(contentsOf: "\(timestamp)".bytes) - .appending(contentsOf: (includeMessageData ? "1" : "0").bytes) + .appending(contentsOf: (includeMessageData ? "1" : "0").bytes) // stringlint:disable .appending( contentsOf: namespaces .map { $0.rawValue } // Intentionally not using `verificationString` here diff --git a/SessionMessagingKit/Sending & Receiving/Notifications/Models/UnsubscribeRequest.swift b/SessionMessagingKit/Sending & Receiving/Notifications/Models/UnsubscribeRequest.swift index 3d76f76ab..9e07b025d 100644 --- a/SessionMessagingKit/Sending & Receiving/Notifications/Models/UnsubscribeRequest.swift +++ b/SessionMessagingKit/Sending & Receiving/Notifications/Models/UnsubscribeRequest.swift @@ -91,7 +91,7 @@ extension PushNotificationAPI { /// `"UNSUBSCRIBE" || HEX(ACCOUNT) || SIG_TS` /// /// Where `SIG_TS` is the `sig_ts` value as a base-10 string and must be within 24 hours of the current time. - let verificationBytes: [UInt8] = "UNSUBSCRIBE".bytes + let verificationBytes: [UInt8] = "UNSUBSCRIBE".bytes // stringlint:disable .appending(contentsOf: pubkey.bytes) .appending(contentsOf: "\(timestamp)".data(using: .ascii)?.bytes) diff --git a/SessionMessagingKit/Sending & Receiving/Notifications/PushNotificationAPI.swift b/SessionMessagingKit/Sending & Receiving/Notifications/PushNotificationAPI.swift index 1bb6428ab..21a3add92 100644 --- a/SessionMessagingKit/Sending & Receiving/Notifications/PushNotificationAPI.swift +++ b/SessionMessagingKit/Sending & Receiving/Notifications/PushNotificationAPI.swift @@ -1,5 +1,7 @@ // Copyright © 2022 Rangeproof Pty Ltd. All rights reserved. +// stringlint:disable + import Foundation import Combine import GRDB diff --git a/SessionMessagingKit/Sending & Receiving/Pollers/CurrentUserPoller.swift b/SessionMessagingKit/Sending & Receiving/Pollers/CurrentUserPoller.swift index bf69dd878..21bf40409 100644 --- a/SessionMessagingKit/Sending & Receiving/Pollers/CurrentUserPoller.swift +++ b/SessionMessagingKit/Sending & Receiving/Pollers/CurrentUserPoller.swift @@ -45,7 +45,7 @@ public final class CurrentUserPoller: Poller { // MARK: - Abstract Methods override func pollerName(for publicKey: String) -> String { - return "Main Poller" + return "Main Poller" // stringlint:disable } override func nextPollDelay(for publicKey: String, using dependencies: Dependencies) -> TimeInterval { diff --git a/SessionMessagingKit/Sending & Receiving/Pollers/OpenGroupPoller.swift b/SessionMessagingKit/Sending & Receiving/Pollers/OpenGroupPoller.swift index 0192286ea..ddbb23c1a 100644 --- a/SessionMessagingKit/Sending & Receiving/Pollers/OpenGroupPoller.swift +++ b/SessionMessagingKit/Sending & Receiving/Pollers/OpenGroupPoller.swift @@ -314,7 +314,7 @@ extension OpenGroupAPI { case .httpRequestFailedAtDestination(let statusCode, let data, _) = error, statusCode == 400, let dataString: String = String(data: data, encoding: .utf8), - dataString.contains("Invalid authentication: this server requires the use of blinded ids") + dataString.contains("Invalid authentication: this server requires the use of blinded ids") // stringlint:disable else { return Just(false) .setFailureType(to: Error.self) diff --git a/SessionMessagingKit/Sending & Receiving/Pollers/Poller.swift b/SessionMessagingKit/Sending & Receiving/Pollers/Poller.swift index 91b43e9e1..d3c18cb49 100644 --- a/SessionMessagingKit/Sending & Receiving/Pollers/Poller.swift +++ b/SessionMessagingKit/Sending & Receiving/Pollers/Poller.swift @@ -223,7 +223,7 @@ public class Poller { let pollerName: String = ( poller?.pollerName(for: publicKey) ?? - "poller with public key \(publicKey)" + "poller with public key \(publicKey)" // stringlint:disable ) let configHashes: [String] = SessionUtil.configHashes(for: publicKey) @@ -271,7 +271,7 @@ public class Poller { var hadValidHashUpdate: Bool = false var configMessageJobsToRun: [Job] = [] var standardMessageJobsToRun: [Job] = [] - var pollerLogOutput: String = "\(pollerName) failed to process any messages" + var pollerLogOutput: String = "\(pollerName) failed to process any messages" // stringlint:disable dependencies.storage.write { db in let allProcessedMessages: [ProcessedMessage] = allMessages diff --git a/SessionNotificationServiceExtension/NotificationServiceExtension.swift b/SessionNotificationServiceExtension/NotificationServiceExtension.swift index 26b394dec..36c4839a7 100644 --- a/SessionNotificationServiceExtension/NotificationServiceExtension.swift +++ b/SessionNotificationServiceExtension/NotificationServiceExtension.swift @@ -357,7 +357,7 @@ public final class NotificationServiceExtension: UNNotificationServiceExtension .localized() } else { - notificationContent.body = "Incoming call..." + notificationContent.body = "Incoming call..." // FIXME: Localized } let identifier = self.request?.identifier ?? UUID().uuidString diff --git a/SessionUIKit/Components/ProfilePictureView.swift b/SessionUIKit/Components/ProfilePictureView.swift index b05e69606..fc9895aca 100644 --- a/SessionUIKit/Components/ProfilePictureView.swift +++ b/SessionUIKit/Components/ProfilePictureView.swift @@ -394,10 +394,7 @@ public final class ProfilePictureView: UIView { } case .rightPlus: - imageView.image = UIImage( - systemName: "plus", - withConfiguration: UIImage.SymbolConfiguration(weight: .semibold) - ) + imageView.image = UIImage(systemName: "plus", withConfiguration: UIImage.SymbolConfiguration(weight: .semibold)) imageView.themeTintColor = .black backgroundView.themeBackgroundColor = .primary } diff --git a/SessionUIKit/Style Guide/Format.swift b/SessionUIKit/Style Guide/Format.swift index 83c1cbf98..f715388a6 100644 --- a/SessionUIKit/Style Guide/Format.swift +++ b/SessionUIKit/Style Guide/Format.swift @@ -39,6 +39,6 @@ public enum Format { } public static func duration(_ duration: TimeInterval) -> String { - return (Format.durationFormatter.string(from: duration) ?? "0:00") + return (Format.durationFormatter.string(from: duration) ?? "0:00") // stringlint:disable } } diff --git a/SessionUIKit/Style Guide/Themes/Theme.swift b/SessionUIKit/Style Guide/Themes/Theme.swift index e6726e430..2b00acef8 100644 --- a/SessionUIKit/Style Guide/Themes/Theme.swift +++ b/SessionUIKit/Style Guide/Themes/Theme.swift @@ -15,10 +15,10 @@ public enum Theme: String, CaseIterable, Codable, EnumStringSetting { public var title: String { switch self { - case .classicDark: return "appearanceThemesClassicDark" - case .classicLight: return "appearanceThemesClassicLight" - case .oceanDark: return "appearanceThemesOceanDark" - case .oceanLight: return "appearanceThemesOceanLight" + case .classicDark: return "appearanceThemesClassicDark".localized() + case .classicLight: return "appearanceThemesClassicLight".localized() + case .oceanDark: return "appearanceThemesOceanDark".localized() + case .oceanLight: return "appearanceThemesOceanLight".localized() } } diff --git a/SessionUtilitiesKit/General/Localization.swift b/SessionUtilitiesKit/General/Localization.swift index 549d6c8f2..47890a1db 100644 --- a/SessionUtilitiesKit/General/Localization.swift +++ b/SessionUtilitiesKit/General/Localization.swift @@ -1,5 +1,7 @@ // Copyright © 2024 Rangeproof Pty Ltd. All rights reserved. +// stringlint:disable + import Foundation public extension NSAttributedString { diff --git a/SessionUtilitiesKit/Utilities/UIApplicationState+Utilities.swift b/SessionUtilitiesKit/Utilities/UIApplicationState+Utilities.swift index cbd30f8d4..aee1bf2ad 100644 --- a/SessionUtilitiesKit/Utilities/UIApplicationState+Utilities.swift +++ b/SessionUtilitiesKit/Utilities/UIApplicationState+Utilities.swift @@ -1,5 +1,7 @@ // Copyright © 2024 Rangeproof Pty Ltd. All rights reserved. +// stringlint:disable + import UIKit.UIApplication public extension UIApplication.State { diff --git a/SignalUtilitiesKit/Media Viewing & Editing/Attachment Approval/AttachmentTextToolbar.swift b/SignalUtilitiesKit/Media Viewing & Editing/Attachment Approval/AttachmentTextToolbar.swift index a0aa08867..d81478181 100644 --- a/SignalUtilitiesKit/Media Viewing & Editing/Attachment Approval/AttachmentTextToolbar.swift +++ b/SignalUtilitiesKit/Media Viewing & Editing/Attachment Approval/AttachmentTextToolbar.swift @@ -169,7 +169,7 @@ class AttachmentTextToolbar: UIView, UITextViewDelegate { private lazy var placeholderTextView: UITextView = { let placeholderTextView = buildTextView() - placeholderTextView.text = "Message" + placeholderTextView.text = "message".localized() placeholderTextView.isEditable = false return placeholderTextView