From a90a89ea4fe19409c2f2bafaffeed54cbb9d8202 Mon Sep 17 00:00:00 2001 From: Niels Andriesse Date: Mon, 19 Jul 2021 09:29:26 +1000 Subject: [PATCH 1/7] Remove CocoaLumberjack --- Session/Meta/Session-Prefix.pch | 6 ------ Session/Meta/SignalApp.m | 1 - 2 files changed, 7 deletions(-) diff --git a/Session/Meta/Session-Prefix.pch b/Session/Meta/Session-Prefix.pch index 266fb1857..5dbd16ebf 100644 --- a/Session/Meta/Session-Prefix.pch +++ b/Session/Meta/Session-Prefix.pch @@ -8,12 +8,6 @@ #import #import - #ifdef DEBUG - static const NSUInteger ddLogLevel = DDLogLevelAll; - #else - static const NSUInteger ddLogLevel = DDLogLevelInfo; - #endif - #import #import #import diff --git a/Session/Meta/SignalApp.m b/Session/Meta/SignalApp.m index 34d2d371f..2e6e6d688 100644 --- a/Session/Meta/SignalApp.m +++ b/Session/Meta/SignalApp.m @@ -147,7 +147,6 @@ NS_ASSUME_NONNULL_BEGIN [Environment.shared.preferences clear]; [AppEnvironment.shared.notificationPresenter clearAllNotifications]; - [DebugLogger.sharedLogger wipeLogs]; if (onReset != nil) { onReset(); } exit(0); } From 614626bffbe362a7f649e4cb3c1d2266aa7158a6 Mon Sep 17 00:00:00 2001 From: Niels Andriesse Date: Mon, 19 Jul 2021 09:35:11 +1000 Subject: [PATCH 2/7] Update build number --- Session.xcodeproj/project.pbxproj | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Session.xcodeproj/project.pbxproj b/Session.xcodeproj/project.pbxproj index 4fcd9add1..5325a1095 100644 --- a/Session.xcodeproj/project.pbxproj +++ b/Session.xcodeproj/project.pbxproj @@ -5059,7 +5059,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 267; + CURRENT_PROJECT_VERSION = 268; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; @@ -5128,7 +5128,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 267; + CURRENT_PROJECT_VERSION = 268; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = SUQ8J2PCT7; ENABLE_NS_ASSERTIONS = NO; @@ -5189,7 +5189,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 267; + CURRENT_PROJECT_VERSION = 268; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; @@ -5259,7 +5259,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 267; + CURRENT_PROJECT_VERSION = 268; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = SUQ8J2PCT7; ENABLE_NS_ASSERTIONS = NO; @@ -6144,7 +6144,7 @@ CODE_SIGN_ENTITLEMENTS = Session/Meta/Signal.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 267; + CURRENT_PROJECT_VERSION = 268; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -6212,7 +6212,7 @@ CODE_SIGN_ENTITLEMENTS = Session/Meta/Signal.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 267; + CURRENT_PROJECT_VERSION = 268; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", From 017f4c7ea57745f4f0e7626611a9969683dfe15a Mon Sep 17 00:00:00 2001 From: Niels Andriesse Date: Mon, 19 Jul 2021 09:44:36 +1000 Subject: [PATCH 3/7] Remove orphaned code --- Session/Meta/AppDelegate.m | 9 --------- 1 file changed, 9 deletions(-) diff --git a/Session/Meta/AppDelegate.m b/Session/Meta/AppDelegate.m index 9c7500536..1ab79f8e4 100644 --- a/Session/Meta/AppDelegate.m +++ b/Session/Meta/AppDelegate.m @@ -159,15 +159,6 @@ static NSTimeInterval launchStartedAt; // XXX - careful when moving this. It must happen before we initialize OWSPrimaryStorage. [self verifyDBKeysAvailableBeforeBackgroundLaunch]; -#if RELEASE - // ensureIsReadyForAppExtensions may have changed the state of the logging - // preference (due to [NSUserDefaults migrateToSharedUserDefaults]), so honor - // that change if necessary. - if (isLoggingEnabled && !OWSPreferences.isLoggingEnabled) { - [DebugLogger.sharedLogger disableFileLogging]; - } -#endif - [AppVersion sharedInstance]; // Prevent the device from sleeping during database view async registration From 5fca1de866bc8f7ca2fd5ec128653266599afce2 Mon Sep 17 00:00:00 2001 From: Niels Andriesse Date: Mon, 19 Jul 2021 10:52:00 +1000 Subject: [PATCH 4/7] Update the build number again App Store processing is stuck --- Session.xcodeproj/project.pbxproj | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Session.xcodeproj/project.pbxproj b/Session.xcodeproj/project.pbxproj index 5325a1095..ddb9227a2 100644 --- a/Session.xcodeproj/project.pbxproj +++ b/Session.xcodeproj/project.pbxproj @@ -5059,7 +5059,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 268; + CURRENT_PROJECT_VERSION = 269; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; @@ -5128,7 +5128,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 268; + CURRENT_PROJECT_VERSION = 269; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = SUQ8J2PCT7; ENABLE_NS_ASSERTIONS = NO; @@ -5189,7 +5189,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 268; + CURRENT_PROJECT_VERSION = 269; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; @@ -5259,7 +5259,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 268; + CURRENT_PROJECT_VERSION = 269; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = SUQ8J2PCT7; ENABLE_NS_ASSERTIONS = NO; @@ -6144,7 +6144,7 @@ CODE_SIGN_ENTITLEMENTS = Session/Meta/Signal.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 268; + CURRENT_PROJECT_VERSION = 269; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -6212,7 +6212,7 @@ CODE_SIGN_ENTITLEMENTS = Session/Meta/Signal.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 268; + CURRENT_PROJECT_VERSION = 269; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", From 6d2044f230a1be24a5a7045f018cd33e1e986fde Mon Sep 17 00:00:00 2001 From: Niels Andriesse Date: Mon, 19 Jul 2021 13:15:02 +1000 Subject: [PATCH 5/7] Warn users if they're about to send their recovery phrase to someone --- Session.xcodeproj/project.pbxproj | 4 ++ .../ConversationVC+Interaction.swift | 10 ++- Session/Conversations/ConversationVC.swift | 10 +++ .../Views & Modals/SendSeedModal.swift | 67 +++++++++++++++++++ .../Translations/de.lproj/Localizable.strings | 3 + .../Translations/en.lproj/Localizable.strings | 3 + .../Translations/es.lproj/Localizable.strings | 3 + .../Translations/fa.lproj/Localizable.strings | 3 + .../Translations/fi.lproj/Localizable.strings | 3 + .../Translations/fr.lproj/Localizable.strings | 3 + .../Translations/hi.lproj/Localizable.strings | 3 + .../Translations/hr.lproj/Localizable.strings | 3 + .../id-ID.lproj/Localizable.strings | 3 + .../Translations/it.lproj/Localizable.strings | 3 + .../Translations/ja.lproj/Localizable.strings | 3 + .../Translations/nl.lproj/Localizable.strings | 3 + .../Translations/pl.lproj/Localizable.strings | 3 + .../pt_BR.lproj/Localizable.strings | 3 + .../Translations/ru.lproj/Localizable.strings | 3 + .../Translations/sk.lproj/Localizable.strings | 3 + .../Translations/sv.lproj/Localizable.strings | 3 + .../Translations/th.lproj/Localizable.strings | 3 + .../vi-VN.lproj/Localizable.strings | 3 + .../zh-Hant.lproj/Localizable.strings | 3 + .../zh_CN.lproj/Localizable.strings | 3 + 25 files changed, 153 insertions(+), 1 deletion(-) create mode 100644 Session/Conversations/Views & Modals/SendSeedModal.swift diff --git a/Session.xcodeproj/project.pbxproj b/Session.xcodeproj/project.pbxproj index ddb9227a2..69295191d 100644 --- a/Session.xcodeproj/project.pbxproj +++ b/Session.xcodeproj/project.pbxproj @@ -237,6 +237,7 @@ B8AE75A425A6C6A6001A84D2 /* Data+Trimming.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8AE75A325A6C6A6001A84D2 /* Data+Trimming.swift */; }; B8AE760B25ABFB5A001A84D2 /* GeneralUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = B8AE760A25ABFB5A001A84D2 /* GeneralUtilities.m */; }; B8AE761425ABFBB9001A84D2 /* GeneralUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = B8AE760925ABFB00001A84D2 /* GeneralUtilities.h */; settings = {ATTRIBUTES = (Public, ); }; }; + B8AF4BB426A5204600583500 /* SendSeedModal.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8AF4BB326A5204600583500 /* SendSeedModal.swift */; }; B8B32021258B1A650020074B /* Contact.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8B32020258B1A650020074B /* Contact.swift */; }; B8B32033258B235D0020074B /* Storage+Contacts.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8B32032258B235D0020074B /* Storage+Contacts.swift */; }; B8B3204E258C15C80020074B /* ContactsMigration.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8B32044258C117C0020074B /* ContactsMigration.swift */; }; @@ -1197,6 +1198,7 @@ B8AE75A325A6C6A6001A84D2 /* Data+Trimming.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Data+Trimming.swift"; sourceTree = ""; }; B8AE760925ABFB00001A84D2 /* GeneralUtilities.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneralUtilities.h; sourceTree = ""; }; B8AE760A25ABFB5A001A84D2 /* GeneralUtilities.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GeneralUtilities.m; sourceTree = ""; }; + B8AF4BB326A5204600583500 /* SendSeedModal.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SendSeedModal.swift; sourceTree = ""; }; B8B32020258B1A650020074B /* Contact.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Contact.swift; sourceTree = ""; }; B8B32032258B235D0020074B /* Storage+Contacts.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Storage+Contacts.swift"; sourceTree = ""; }; B8B32044258C117C0020074B /* ContactsMigration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContactsMigration.swift; sourceTree = ""; }; @@ -2109,6 +2111,7 @@ B8F5F72225F1B4CA003BF8D4 /* DownloadAttachmentModal.swift */, C3A76A8C25DB83F90074CB90 /* PermissionMissingModal.swift */, B821494525D4D6FF009C0F2A /* URLModal.swift */, + B8AF4BB326A5204600583500 /* SendSeedModal.swift */, B8758859264503A6000E60D0 /* JoinOpenGroupModal.swift */, B821494E25D4E163009C0F2A /* BodyTextView.swift */, B82149B725D60393009C0F2A /* BlockedModal.swift */, @@ -4820,6 +4823,7 @@ B82B408E239DC00D00A248E7 /* DisplayNameVC.swift in Sources */, B8214A2B25D63EB9009C0F2A /* MessagesTableView.swift in Sources */, B835246E25C38ABF0089A44F /* ConversationVC.swift in Sources */, + B8AF4BB426A5204600583500 /* SendSeedModal.swift in Sources */, B821494625D4D6FF009C0F2A /* URLModal.swift in Sources */, C374EEEB25DA3CA70073A857 /* ConversationTitleView.swift in Sources */, B88FA7F2260C3EB10049422F /* OpenGroupSuggestionGrid.swift in Sources */, diff --git a/Session/Conversations/ConversationVC+Interaction.swift b/Session/Conversations/ConversationVC+Interaction.swift index 795cc80ae..4b642b95e 100644 --- a/Session/Conversations/ConversationVC+Interaction.swift +++ b/Session/Conversations/ConversationVC+Interaction.swift @@ -195,11 +195,19 @@ extension ConversationVC : InputViewDelegate, MessageCellDelegate, ContextMenuAc sendMessage() } - func sendMessage() { + func sendMessage(hasPermissionToSendSeed: Bool = false) { guard !showBlockedModalIfNeeded() else { return } let text = replaceMentions(in: snInputView.text.trimmingCharacters(in: .whitespacesAndNewlines)) let thread = self.thread guard !text.isEmpty else { return } + if text.contains(mnemonic) && !thread.isNoteToSelf() && !hasPermissionToSendSeed { + // Warn the user if they're about to send their seed to someone + let modal = SendSeedModal() + modal.modalPresentationStyle = .overFullScreen + modal.modalTransitionStyle = .crossDissolve + modal.proceed = { self.sendMessage(hasPermissionToSendSeed: true) } + return present(modal, animated: true, completion: nil) + } let message = VisibleMessage() message.sentTimestamp = NSDate.millisecondTimestamp() message.text = text diff --git a/Session/Conversations/ConversationVC.swift b/Session/Conversations/ConversationVC.swift index c1568f11a..2b61c9b1f 100644 --- a/Session/Conversations/ConversationVC.swift +++ b/Session/Conversations/ConversationVC.swift @@ -55,6 +55,16 @@ final class ConversationVC : BaseVC, ConversationViewModelDelegate, OWSConversat return messagesTableView.contentSize.height - tableViewUnobscuredHeight } + lazy var mnemonic: String = { + let identityManager = OWSIdentityManager.shared() + let databaseConnection = identityManager.value(forKey: "dbConnection") as! YapDatabaseConnection + var hexEncodedSeed: String! = databaseConnection.object(forKey: "LKLokiSeed", inCollection: OWSPrimaryStorageIdentityKeyStoreCollection) as! String? + if hexEncodedSeed == nil { + hexEncodedSeed = identityManager.identityKeyPair()!.hexEncodedPrivateKey // Legacy account + } + return Mnemonic.encode(hexEncodedString: hexEncodedSeed) + }() + lazy var viewModel = ConversationViewModel(thread: thread, focusMessageIdOnOpen: focusedMessageID, delegate: self) lazy var mediaCache: NSCache = { diff --git a/Session/Conversations/Views & Modals/SendSeedModal.swift b/Session/Conversations/Views & Modals/SendSeedModal.swift new file mode 100644 index 000000000..0e8ac6221 --- /dev/null +++ b/Session/Conversations/Views & Modals/SendSeedModal.swift @@ -0,0 +1,67 @@ + +final class SendSeedModal : Modal { + var proceed: (() -> Void)? = nil + + private lazy var titleLabel: UILabel = { + let result = UILabel() + result.textColor = Colors.text + result.font = .boldSystemFont(ofSize: Values.largeFontSize) + result.text = NSLocalizedString("modal_send_seed_title", comment: "") + result.textAlignment = .center + return result + }() + + private lazy var explanationLabel: UILabel = { + let result = UILabel() + result.textColor = Colors.text + result.font = .systemFont(ofSize: Values.smallFontSize) + result.text = NSLocalizedString("modal_send_seed_explanation", comment: "") + result.numberOfLines = 0 + result.lineBreakMode = .byWordWrapping + result.textAlignment = .center + return result + }() + + private lazy var sendSeedButton: UIButton = { + let result = UIButton() + result.set(.height, to: Values.mediumButtonHeight) + result.layer.cornerRadius = Modal.buttonCornerRadius + if isDarkMode { + result.backgroundColor = Colors.destructive + } + result.titleLabel!.font = .systemFont(ofSize: Values.smallFontSize) + result.setTitleColor(isLightMode ? Colors.destructive : Colors.text, for: UIControl.State.normal) + result.setTitle(NSLocalizedString("modal_send_seed_send_button_title", comment: ""), for: UIControl.State.normal) + result.addTarget(self, action: #selector(sendSeed), for: UIControl.Event.touchUpInside) + return result + }() + + private lazy var buttonStackView: UIStackView = { + let result = UIStackView(arrangedSubviews: [ cancelButton, sendSeedButton ]) + result.axis = .horizontal + result.spacing = Values.mediumSpacing + result.distribution = .fillEqually + return result + }() + + private lazy var mainStackView: UIStackView = { + let result = UIStackView(arrangedSubviews: [ titleLabel, explanationLabel, buttonStackView ]) + result.axis = .vertical + result.spacing = Values.largeSpacing + return result + }() + + override func populateContentView() { + contentView.addSubview(mainStackView) + mainStackView.pin(.leading, to: .leading, of: contentView, withInset: Values.largeSpacing) + mainStackView.pin(.top, to: .top, of: contentView, withInset: Values.largeSpacing) + contentView.pin(.trailing, to: .trailing, of: mainStackView, withInset: Values.largeSpacing) + contentView.pin(.bottom, to: .bottom, of: mainStackView, withInset: Values.largeSpacing) + } + + // MARK: Interaction + @objc private func sendSeed() { + proceed?() + presentingViewController?.dismiss(animated: true, completion: nil) + } +} diff --git a/Session/Meta/Translations/de.lproj/Localizable.strings b/Session/Meta/Translations/de.lproj/Localizable.strings index 43a4309b7..edbde38f7 100644 --- a/Session/Meta/Translations/de.lproj/Localizable.strings +++ b/Session/Meta/Translations/de.lproj/Localizable.strings @@ -543,3 +543,6 @@ "view_open_group_invitation_description" = "Gruppeneinladung öffnen"; "vc_conversation_settings_invite_button_title" = "Mitglieder hinzufügen"; "vc_settings_faq_button_title" = "FAQ"; +"modal_send_seed_title" = "Warning"; +"modal_send_seed_explanation" = "This is your recovery phrase. If you send it to someone they'll have full access to your account."; +"modal_send_seed_send_button_title" = "Send"; diff --git a/Session/Meta/Translations/en.lproj/Localizable.strings b/Session/Meta/Translations/en.lproj/Localizable.strings index 0a13fec39..c1f7a7f76 100644 --- a/Session/Meta/Translations/en.lproj/Localizable.strings +++ b/Session/Meta/Translations/en.lproj/Localizable.strings @@ -543,3 +543,6 @@ "view_open_group_invitation_description" = "Open group invitation"; "vc_conversation_settings_invite_button_title" = "Add Members"; "vc_settings_faq_button_title" = "FAQ"; +"modal_send_seed_title" = "Warning"; +"modal_send_seed_explanation" = "This is your recovery phrase. If you send it to someone they'll have full access to your account."; +"modal_send_seed_send_button_title" = "Send"; diff --git a/Session/Meta/Translations/es.lproj/Localizable.strings b/Session/Meta/Translations/es.lproj/Localizable.strings index 49f9ab398..2c758a958 100644 --- a/Session/Meta/Translations/es.lproj/Localizable.strings +++ b/Session/Meta/Translations/es.lproj/Localizable.strings @@ -543,3 +543,6 @@ "view_open_group_invitation_description" = "Abrir invitación de grupo"; "vc_conversation_settings_invite_button_title" = "Añadir Miembros"; "vc_settings_faq_button_title" = "FAQ"; +"modal_send_seed_title" = "Warning"; +"modal_send_seed_explanation" = "This is your recovery phrase. If you send it to someone they'll have full access to your account."; +"modal_send_seed_send_button_title" = "Send"; diff --git a/Session/Meta/Translations/fa.lproj/Localizable.strings b/Session/Meta/Translations/fa.lproj/Localizable.strings index 28c45e42c..8c7f27588 100644 --- a/Session/Meta/Translations/fa.lproj/Localizable.strings +++ b/Session/Meta/Translations/fa.lproj/Localizable.strings @@ -543,3 +543,6 @@ "view_open_group_invitation_description" = "Open group invitation"; "vc_conversation_settings_invite_button_title" = "Add Members"; "vc_settings_faq_button_title" = "FAQ"; +"modal_send_seed_title" = "Warning"; +"modal_send_seed_explanation" = "This is your recovery phrase. If you send it to someone they'll have full access to your account."; +"modal_send_seed_send_button_title" = "Send"; diff --git a/Session/Meta/Translations/fi.lproj/Localizable.strings b/Session/Meta/Translations/fi.lproj/Localizable.strings index 67efc018b..058f05a0d 100644 --- a/Session/Meta/Translations/fi.lproj/Localizable.strings +++ b/Session/Meta/Translations/fi.lproj/Localizable.strings @@ -543,3 +543,6 @@ "view_open_group_invitation_description" = "Avaa ryhmäkutsu"; "vc_conversation_settings_invite_button_title" = "Lisää jäseniä"; "vc_settings_faq_button_title" = "FAQ"; +"modal_send_seed_title" = "Warning"; +"modal_send_seed_explanation" = "This is your recovery phrase. If you send it to someone they'll have full access to your account."; +"modal_send_seed_send_button_title" = "Send"; diff --git a/Session/Meta/Translations/fr.lproj/Localizable.strings b/Session/Meta/Translations/fr.lproj/Localizable.strings index 7ab1cb9e0..116e66da9 100644 --- a/Session/Meta/Translations/fr.lproj/Localizable.strings +++ b/Session/Meta/Translations/fr.lproj/Localizable.strings @@ -543,3 +543,6 @@ "view_open_group_invitation_description" = "Invitation à un groupe ouvert"; "vc_conversation_settings_invite_button_title" = "Ajouter des membres"; "vc_settings_faq_button_title" = "FAQ"; +"modal_send_seed_title" = "Warning"; +"modal_send_seed_explanation" = "This is your recovery phrase. If you send it to someone they'll have full access to your account."; +"modal_send_seed_send_button_title" = "Send"; diff --git a/Session/Meta/Translations/hi.lproj/Localizable.strings b/Session/Meta/Translations/hi.lproj/Localizable.strings index 676eb53fc..62c69c9ab 100644 --- a/Session/Meta/Translations/hi.lproj/Localizable.strings +++ b/Session/Meta/Translations/hi.lproj/Localizable.strings @@ -543,3 +543,6 @@ "view_open_group_invitation_description" = "ग्रुप आमंत्रण खोलें"; "vc_conversation_settings_invite_button_title" = "सदस्य जोड़ें"; "vc_settings_faq_button_title" = "FAQ"; +"modal_send_seed_title" = "Warning"; +"modal_send_seed_explanation" = "This is your recovery phrase. If you send it to someone they'll have full access to your account."; +"modal_send_seed_send_button_title" = "Send"; diff --git a/Session/Meta/Translations/hr.lproj/Localizable.strings b/Session/Meta/Translations/hr.lproj/Localizable.strings index 1792a4218..a4f1ecec0 100644 --- a/Session/Meta/Translations/hr.lproj/Localizable.strings +++ b/Session/Meta/Translations/hr.lproj/Localizable.strings @@ -543,3 +543,6 @@ "view_open_group_invitation_description" = "Otvori pozivnicu za grupu"; "vc_conversation_settings_invite_button_title" = "Dodaj članove"; "vc_settings_faq_button_title" = "FAQ"; +"modal_send_seed_title" = "Warning"; +"modal_send_seed_explanation" = "This is your recovery phrase. If you send it to someone they'll have full access to your account."; +"modal_send_seed_send_button_title" = "Send"; diff --git a/Session/Meta/Translations/id-ID.lproj/Localizable.strings b/Session/Meta/Translations/id-ID.lproj/Localizable.strings index d987723e1..4ea14eeb4 100644 --- a/Session/Meta/Translations/id-ID.lproj/Localizable.strings +++ b/Session/Meta/Translations/id-ID.lproj/Localizable.strings @@ -543,3 +543,6 @@ "view_open_group_invitation_description" = "Open group invitation"; "vc_conversation_settings_invite_button_title" = "Add Members"; "vc_settings_faq_button_title" = "FAQ"; +"modal_send_seed_title" = "Warning"; +"modal_send_seed_explanation" = "This is your recovery phrase. If you send it to someone they'll have full access to your account."; +"modal_send_seed_send_button_title" = "Send"; diff --git a/Session/Meta/Translations/it.lproj/Localizable.strings b/Session/Meta/Translations/it.lproj/Localizable.strings index 7de094dd1..d13c5ddb5 100644 --- a/Session/Meta/Translations/it.lproj/Localizable.strings +++ b/Session/Meta/Translations/it.lproj/Localizable.strings @@ -543,3 +543,6 @@ "view_open_group_invitation_description" = "Apri invito di gruppo"; "vc_conversation_settings_invite_button_title" = "Aggiungi membri"; "vc_settings_faq_button_title" = "FAQ"; +"modal_send_seed_title" = "Warning"; +"modal_send_seed_explanation" = "This is your recovery phrase. If you send it to someone they'll have full access to your account."; +"modal_send_seed_send_button_title" = "Send"; diff --git a/Session/Meta/Translations/ja.lproj/Localizable.strings b/Session/Meta/Translations/ja.lproj/Localizable.strings index bc0388ea8..faf24bdc6 100644 --- a/Session/Meta/Translations/ja.lproj/Localizable.strings +++ b/Session/Meta/Translations/ja.lproj/Localizable.strings @@ -543,3 +543,6 @@ "view_open_group_invitation_description" = "公開グループからの招待"; "vc_conversation_settings_invite_button_title" = "メンバーを追加する"; "vc_settings_faq_button_title" = "FAQ"; +"modal_send_seed_title" = "Warning"; +"modal_send_seed_explanation" = "This is your recovery phrase. If you send it to someone they'll have full access to your account."; +"modal_send_seed_send_button_title" = "Send"; diff --git a/Session/Meta/Translations/nl.lproj/Localizable.strings b/Session/Meta/Translations/nl.lproj/Localizable.strings index 1c4de8477..8967ddfc9 100644 --- a/Session/Meta/Translations/nl.lproj/Localizable.strings +++ b/Session/Meta/Translations/nl.lproj/Localizable.strings @@ -543,3 +543,6 @@ "view_open_group_invitation_description" = "Open groepsuitnodiging"; "vc_conversation_settings_invite_button_title" = "Voeg deelnemers toe"; "vc_settings_faq_button_title" = "FAQ"; +"modal_send_seed_title" = "Warning"; +"modal_send_seed_explanation" = "This is your recovery phrase. If you send it to someone they'll have full access to your account."; +"modal_send_seed_send_button_title" = "Send"; diff --git a/Session/Meta/Translations/pl.lproj/Localizable.strings b/Session/Meta/Translations/pl.lproj/Localizable.strings index 6e43e40b5..59a6706ae 100644 --- a/Session/Meta/Translations/pl.lproj/Localizable.strings +++ b/Session/Meta/Translations/pl.lproj/Localizable.strings @@ -543,3 +543,6 @@ "view_open_group_invitation_description" = "Otwórz zaproszenie do grupy"; "vc_conversation_settings_invite_button_title" = "Dodaj użytkowników"; "vc_settings_faq_button_title" = "FAQ"; +"modal_send_seed_title" = "Warning"; +"modal_send_seed_explanation" = "This is your recovery phrase. If you send it to someone they'll have full access to your account."; +"modal_send_seed_send_button_title" = "Send"; diff --git a/Session/Meta/Translations/pt_BR.lproj/Localizable.strings b/Session/Meta/Translations/pt_BR.lproj/Localizable.strings index b23b71e9a..2555e945c 100644 --- a/Session/Meta/Translations/pt_BR.lproj/Localizable.strings +++ b/Session/Meta/Translations/pt_BR.lproj/Localizable.strings @@ -543,3 +543,6 @@ "view_open_group_invitation_description" = "Convite para grupo aberto"; "vc_conversation_settings_invite_button_title" = "Adicionar Membros"; "vc_settings_faq_button_title" = "FAQ"; +"modal_send_seed_title" = "Warning"; +"modal_send_seed_explanation" = "This is your recovery phrase. If you send it to someone they'll have full access to your account."; +"modal_send_seed_send_button_title" = "Send"; diff --git a/Session/Meta/Translations/ru.lproj/Localizable.strings b/Session/Meta/Translations/ru.lproj/Localizable.strings index 67123ddaf..89119cb53 100644 --- a/Session/Meta/Translations/ru.lproj/Localizable.strings +++ b/Session/Meta/Translations/ru.lproj/Localizable.strings @@ -543,3 +543,6 @@ "view_open_group_invitation_description" = "Открыть приглашение в группу"; "vc_conversation_settings_invite_button_title" = "Добавить участников"; "vc_settings_faq_button_title" = "FAQ"; +"modal_send_seed_title" = "Warning"; +"modal_send_seed_explanation" = "This is your recovery phrase. If you send it to someone they'll have full access to your account."; +"modal_send_seed_send_button_title" = "Send"; diff --git a/Session/Meta/Translations/sk.lproj/Localizable.strings b/Session/Meta/Translations/sk.lproj/Localizable.strings index 6d9d72935..2ade1f164 100644 --- a/Session/Meta/Translations/sk.lproj/Localizable.strings +++ b/Session/Meta/Translations/sk.lproj/Localizable.strings @@ -543,3 +543,6 @@ "view_open_group_invitation_description" = "Otvoriť skupinovú pozvánku"; "vc_conversation_settings_invite_button_title" = "Pridať členov"; "vc_settings_faq_button_title" = "FAQ"; +"modal_send_seed_title" = "Warning"; +"modal_send_seed_explanation" = "This is your recovery phrase. If you send it to someone they'll have full access to your account."; +"modal_send_seed_send_button_title" = "Send"; diff --git a/Session/Meta/Translations/sv.lproj/Localizable.strings b/Session/Meta/Translations/sv.lproj/Localizable.strings index 66b236006..81332a545 100644 --- a/Session/Meta/Translations/sv.lproj/Localizable.strings +++ b/Session/Meta/Translations/sv.lproj/Localizable.strings @@ -543,3 +543,6 @@ "view_open_group_invitation_description" = "Öppen gruppinbjudan"; "vc_conversation_settings_invite_button_title" = "Lägg till medlemmar"; "vc_settings_faq_button_title" = "FAQ"; +"modal_send_seed_title" = "Warning"; +"modal_send_seed_explanation" = "This is your recovery phrase. If you send it to someone they'll have full access to your account."; +"modal_send_seed_send_button_title" = "Send"; diff --git a/Session/Meta/Translations/th.lproj/Localizable.strings b/Session/Meta/Translations/th.lproj/Localizable.strings index fc2bb2e0c..a92caaefa 100644 --- a/Session/Meta/Translations/th.lproj/Localizable.strings +++ b/Session/Meta/Translations/th.lproj/Localizable.strings @@ -543,3 +543,6 @@ "view_open_group_invitation_description" = "การเชิญเข้าร่วมกลุ่ม"; "vc_conversation_settings_invite_button_title" = "เพิ่มสมาชิก"; "vc_settings_faq_button_title" = "FAQ"; +"modal_send_seed_title" = "Warning"; +"modal_send_seed_explanation" = "This is your recovery phrase. If you send it to someone they'll have full access to your account."; +"modal_send_seed_send_button_title" = "Send"; diff --git a/Session/Meta/Translations/vi-VN.lproj/Localizable.strings b/Session/Meta/Translations/vi-VN.lproj/Localizable.strings index 810f84a67..9742ba586 100644 --- a/Session/Meta/Translations/vi-VN.lproj/Localizable.strings +++ b/Session/Meta/Translations/vi-VN.lproj/Localizable.strings @@ -543,3 +543,6 @@ "view_open_group_invitation_description" = "Open group invitation"; "vc_conversation_settings_invite_button_title" = "Add Members"; "vc_settings_faq_button_title" = "FAQ"; +"modal_send_seed_title" = "Warning"; +"modal_send_seed_explanation" = "This is your recovery phrase. If you send it to someone they'll have full access to your account."; +"modal_send_seed_send_button_title" = "Send"; diff --git a/Session/Meta/Translations/zh-Hant.lproj/Localizable.strings b/Session/Meta/Translations/zh-Hant.lproj/Localizable.strings index 6836f9662..0166c55c2 100644 --- a/Session/Meta/Translations/zh-Hant.lproj/Localizable.strings +++ b/Session/Meta/Translations/zh-Hant.lproj/Localizable.strings @@ -543,3 +543,6 @@ "view_open_group_invitation_description" = "打開群組邀請"; "vc_conversation_settings_invite_button_title" = "新增成員"; "vc_settings_faq_button_title" = "FAQ"; +"modal_send_seed_title" = "Warning"; +"modal_send_seed_explanation" = "This is your recovery phrase. If you send it to someone they'll have full access to your account."; +"modal_send_seed_send_button_title" = "Send"; diff --git a/Session/Meta/Translations/zh_CN.lproj/Localizable.strings b/Session/Meta/Translations/zh_CN.lproj/Localizable.strings index 7e0bc86c7..127219d84 100644 --- a/Session/Meta/Translations/zh_CN.lproj/Localizable.strings +++ b/Session/Meta/Translations/zh_CN.lproj/Localizable.strings @@ -543,3 +543,6 @@ "view_open_group_invitation_description" = "打开群组邀请"; "vc_conversation_settings_invite_button_title" = "添加成员"; "vc_settings_faq_button_title" = "FAQ"; +"modal_send_seed_title" = "Warning"; +"modal_send_seed_explanation" = "This is your recovery phrase. If you send it to someone they'll have full access to your account."; +"modal_send_seed_send_button_title" = "Send"; From 1d1d63c9798cbeea66f34d7c477f4984f10a3aa7 Mon Sep 17 00:00:00 2001 From: Niels Andriesse Date: Mon, 19 Jul 2021 13:22:09 +1000 Subject: [PATCH 6/7] Don't auto resubscribe to PNs for muted closed groups --- .../Notifications/PushNotificationAPI.swift | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/SessionMessagingKit/Sending & Receiving/Notifications/PushNotificationAPI.swift b/SessionMessagingKit/Sending & Receiving/Notifications/PushNotificationAPI.swift index a4943833f..b725e1527 100644 --- a/SessionMessagingKit/Sending & Receiving/Notifications/PushNotificationAPI.swift +++ b/SessionMessagingKit/Sending & Receiving/Notifications/PushNotificationAPI.swift @@ -45,8 +45,8 @@ public final class PushNotificationAPI : NSObject { SNLog("Couldn't unregister from push notifications.") } // Unsubscribe from all closed groups - Storage.shared.getUserClosedGroupPublicKeys().forEach { closedGroup in - performOperation(.unsubscribe, for: closedGroup, publicKey: getUserHexEncodedPublicKey()) + Storage.shared.getUserClosedGroupPublicKeys().forEach { closedGroupPublicKey in + performOperation(.unsubscribe, for: closedGroupPublicKey, publicKey: getUserHexEncodedPublicKey()) } return promise } @@ -87,8 +87,14 @@ public final class PushNotificationAPI : NSObject { SNLog("Couldn't register device token.") } // Subscribe to all closed groups - Storage.shared.getUserClosedGroupPublicKeys().forEach { closedGroup in - performOperation(.subscribe, for: closedGroup, publicKey: publicKey) + Storage.shared.getUserClosedGroupPublicKeys().forEach { closedGroupPublicKey in + let groupID = LKGroupUtilities.getEncodedClosedGroupIDAsData(closedGroupPublicKey) + let threadOrNil = TSGroupThread.fetch(uniqueId: TSGroupThread.threadId(fromGroupId: groupID)) + if threadOrNil?.isMuted == true { + // Do nothing + } else { + performOperation(.subscribe, for: closedGroupPublicKey, publicKey: publicKey) + } } return promise } From 8183e8ea806bf346b85e21932a937ef97ca47993 Mon Sep 17 00:00:00 2001 From: Niels Andriesse Date: Mon, 19 Jul 2021 13:23:15 +1000 Subject: [PATCH 7/7] Update version number --- Session.xcodeproj/project.pbxproj | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Session.xcodeproj/project.pbxproj b/Session.xcodeproj/project.pbxproj index 69295191d..0e70106cf 100644 --- a/Session.xcodeproj/project.pbxproj +++ b/Session.xcodeproj/project.pbxproj @@ -5063,7 +5063,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 269; + CURRENT_PROJECT_VERSION = 270; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; @@ -5084,7 +5084,7 @@ INFOPLIST_FILE = SessionShareExtension/Meta/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; - MARKETING_VERSION = 1.11.10; + MARKETING_VERSION = 1.11.11; MTL_ENABLE_DEBUG_INFO = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.loki-project.loki-messenger.ShareExtension"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -5132,7 +5132,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 269; + CURRENT_PROJECT_VERSION = 270; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = SUQ8J2PCT7; ENABLE_NS_ASSERTIONS = NO; @@ -5158,7 +5158,7 @@ INFOPLIST_FILE = SessionShareExtension/Meta/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; - MARKETING_VERSION = 1.11.10; + MARKETING_VERSION = 1.11.11; MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_BUNDLE_IDENTIFIER = "com.loki-project.loki-messenger.ShareExtension"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -5193,7 +5193,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 269; + CURRENT_PROJECT_VERSION = 270; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; @@ -5212,7 +5212,7 @@ INFOPLIST_FILE = SessionNotificationServiceExtension/Meta/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; - MARKETING_VERSION = 1.11.10; + MARKETING_VERSION = 1.11.11; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.loki-project.loki-messenger.NotificationServiceExtension"; @@ -5263,7 +5263,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 269; + CURRENT_PROJECT_VERSION = 270; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = SUQ8J2PCT7; ENABLE_NS_ASSERTIONS = NO; @@ -5287,7 +5287,7 @@ INFOPLIST_FILE = SessionNotificationServiceExtension/Meta/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; - MARKETING_VERSION = 1.11.10; + MARKETING_VERSION = 1.11.11; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.loki-project.loki-messenger.NotificationServiceExtension"; @@ -6148,7 +6148,7 @@ CODE_SIGN_ENTITLEMENTS = Session/Meta/Signal.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 269; + CURRENT_PROJECT_VERSION = 270; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -6184,7 +6184,7 @@ "$(SRCROOT)", ); LLVM_LTO = NO; - MARKETING_VERSION = 1.11.10; + MARKETING_VERSION = 1.11.11; OTHER_LDFLAGS = "$(inherited)"; OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\""; PRODUCT_BUNDLE_IDENTIFIER = "com.loki-project.loki-messenger"; @@ -6216,7 +6216,7 @@ CODE_SIGN_ENTITLEMENTS = Session/Meta/Signal.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 269; + CURRENT_PROJECT_VERSION = 270; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -6252,7 +6252,7 @@ "$(SRCROOT)", ); LLVM_LTO = NO; - MARKETING_VERSION = 1.11.10; + MARKETING_VERSION = 1.11.11; OTHER_LDFLAGS = "$(inherited)"; PRODUCT_BUNDLE_IDENTIFIER = "com.loki-project.loki-messenger"; PRODUCT_NAME = Session;