From 3a84593de9c0e4c2b5cd0ad18e333f91d6d12b2e Mon Sep 17 00:00:00 2001 From: ryanzhao Date: Thu, 30 Sep 2021 09:20:20 +1000 Subject: [PATCH 01/17] fix profile key crash & typo --- .../Sending & Receiving/MessageReceiver+Handling.swift | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/SessionMessagingKit/Sending & Receiving/MessageReceiver+Handling.swift b/SessionMessagingKit/Sending & Receiving/MessageReceiver+Handling.swift index ba761cc26..dbbeb6818 100644 --- a/SessionMessagingKit/Sending & Receiving/MessageReceiver+Handling.swift +++ b/SessionMessagingKit/Sending & Receiving/MessageReceiver+Handling.swift @@ -189,10 +189,10 @@ extension MessageReceiver { let storage = SNMessagingKitConfiguration.shared.storage let transaction = transaction as! YapDatabaseReadWriteTransaction // Profile - var userProfileKy: OWSAES256Key? = nil - if let profileKey = message.profileKey { userProfileKy = OWSAES256Key(data: profileKey) } + var userProfileKey: OWSAES256Key? = nil + if let profileKey = message.profileKey { userProfileKey = OWSAES256Key(data: profileKey) } updateProfileIfNeeded(publicKey: userPublicKey, name: message.displayName, profilePictureURL: message.profilePictureURL, - profileKey: userProfileKy, sentTimestamp: message.sentTimestamp!, transaction: transaction) + profileKey: userProfileKey, sentTimestamp: message.sentTimestamp!, transaction: transaction) // Initial configuration sync if !UserDefaults.standard[.hasSyncedInitialConfiguration] { UserDefaults.standard[.hasSyncedInitialConfiguration] = true @@ -280,8 +280,10 @@ extension MessageReceiver { // Update profile if needed if let profile = message.profile { let sessionID = message.sender! + var contactProfileKey: OWSAES256Key? = nil + if let profileKey = profile.profileKey { contactProfileKey = OWSAES256Key(data: profileKey) } updateProfileIfNeeded(publicKey: sessionID, name: profile.displayName, profilePictureURL: profile.profilePictureURL, - profileKey: given(profile.profileKey) { OWSAES256Key(data: $0)! }, sentTimestamp: message.sentTimestamp!, transaction: transaction) + profileKey: contactProfileKey, sentTimestamp: message.sentTimestamp!, transaction: transaction) } // Get or create thread guard let threadID = storage.getOrCreateThread(for: message.syncTarget ?? message.sender!, groupPublicKey: message.groupPublicKey, openGroupID: openGroupID, using: transaction) else { throw Error.noThread } From e91469fe0e1c2af75d1ae022411ead19d1133c0f Mon Sep 17 00:00:00 2001 From: ryanzhao Date: Thu, 30 Sep 2021 09:30:30 +1000 Subject: [PATCH 02/17] fix nested transaction crash --- SessionMessagingKit/Database/Storage+Shared.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SessionMessagingKit/Database/Storage+Shared.swift b/SessionMessagingKit/Database/Storage+Shared.swift index 17de9059d..b2752d29d 100644 --- a/SessionMessagingKit/Database/Storage+Shared.swift +++ b/SessionMessagingKit/Database/Storage+Shared.swift @@ -39,7 +39,7 @@ extension Storage { guard let userPublicKey = getUserPublicKey() else { return nil } var result: Contact? Storage.read { transaction in - result = Storage.shared.getContact(with: userPublicKey) + result = Storage.shared.getContact(with: userPublicKey, using: transaction) } return result } From a856415438d92142e9e85dbcabd713a934497ccd Mon Sep 17 00:00:00 2001 From: ryanzhao Date: Thu, 30 Sep 2021 10:53:13 +1000 Subject: [PATCH 03/17] fix conversation screen unread count > viewItems count crash --- Session/Conversations/ConversationVC.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Session/Conversations/ConversationVC.swift b/Session/Conversations/ConversationVC.swift index cc4445e25..5acfbb65b 100644 --- a/Session/Conversations/ConversationVC.swift +++ b/Session/Conversations/ConversationVC.swift @@ -167,7 +167,7 @@ final class ConversationVC : BaseVC, ConversationViewModelDelegate, OWSConversat Storage.read { transaction in unreadCount = self.thread.unreadMessageCount(transaction: transaction) } - let clampedUnreadCount = min(unreadCount, UInt(kConversationInitialMaxRangeSize)) + let clampedUnreadCount = min(unreadCount, UInt(kConversationInitialMaxRangeSize), UInt(viewItems.endIndex)) unreadViewItems = clampedUnreadCount != 0 ? [ConversationViewItem](viewItems[viewItems.endIndex - Int(clampedUnreadCount) ..< viewItems.endIndex]) : [] } From cebda588e8d9cf8b59e4fffbb63f77771a4ebba6 Mon Sep 17 00:00:00 2001 From: ryanzhao Date: Thu, 30 Sep 2021 11:20:00 +1000 Subject: [PATCH 04/17] fix remove job id concurrent issue --- SessionMessagingKit/Jobs/JobQueue.swift | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/SessionMessagingKit/Jobs/JobQueue.swift b/SessionMessagingKit/Jobs/JobQueue.swift index e661189e5..159641522 100644 --- a/SessionMessagingKit/Jobs/JobQueue.swift +++ b/SessionMessagingKit/Jobs/JobQueue.swift @@ -7,6 +7,8 @@ public final class JobQueue : NSObject, JobDelegate { internal static var currentlyExecutingJobs: Set = [] + private let internalQueue: DispatchQueue = DispatchQueue(label:"executingJobQueue") + @objc public static let shared = JobQueue() @objc public func add(_ job: Job, using transaction: Any) { @@ -47,7 +49,7 @@ public final class JobQueue : NSObject, JobDelegate { } public func handleJobSucceeded(_ job: Job) { - given(job.id) { JobQueue.currentlyExecutingJobs.remove($0) } + given(job.id) { removeExecutingJob($0) } SNMessagingKitConfiguration.shared.storage.write(with: { transaction in SNMessagingKitConfiguration.shared.storage.markJobAsSucceeded(job, using: transaction) }, completion: { @@ -56,7 +58,7 @@ public final class JobQueue : NSObject, JobDelegate { } public func handleJobFailed(_ job: Job, with error: Error) { - given(job.id) { JobQueue.currentlyExecutingJobs.remove($0) } + given(job.id) { removeExecutingJob($0) } job.failureCount += 1 let storage = SNMessagingKitConfiguration.shared.storage guard !storage.isJobCanceled(job) else { return SNLog("\(type(of: job)) canceled.") } @@ -78,7 +80,7 @@ public final class JobQueue : NSObject, JobDelegate { } public func handleJobFailedPermanently(_ job: Job, with error: Error) { - given(job.id) { JobQueue.currentlyExecutingJobs.remove($0) } + given(job.id) { removeExecutingJob($0) } job.failureCount += 1 let storage = SNMessagingKitConfiguration.shared.storage storage.write(with: { transaction in @@ -91,6 +93,10 @@ public final class JobQueue : NSObject, JobDelegate { }) }) } + + private func removeExecutingJob(_ jobID: String) { + let _ = internalQueue.sync { JobQueue.currentlyExecutingJobs.remove(jobID) } + } private func getRetryInterval(for job: Job) -> TimeInterval { // Arbitrary backoff factor... From bd73f14915307709de5251d643607d78eae0ddda Mon Sep 17 00:00:00 2001 From: ryanzhao Date: Thu, 30 Sep 2021 11:47:34 +1000 Subject: [PATCH 05/17] fix crash when quoted attachment's content type is null --- .../Conversations/Message Cells/Content Views/QuoteView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Session/Conversations/Message Cells/Content Views/QuoteView.swift b/Session/Conversations/Message Cells/Content Views/QuoteView.swift index e3c45e9cb..a32e07724 100644 --- a/Session/Conversations/Message Cells/Content Views/QuoteView.swift +++ b/Session/Conversations/Message Cells/Content Views/QuoteView.swift @@ -167,7 +167,7 @@ final class QuoteView : UIView { if !hasAttachments { mainStackView.addArrangedSubview(lineView) } else { - let isAudio = MIMETypeUtil.isAudio(attachments.first!.contentType!) + let isAudio = MIMETypeUtil.isAudio(attachments.first!.contentType ?? "") let fallbackImageName = isAudio ? "attachment_audio" : "actionsheet_document_black" let fallbackImage = UIImage(named: fallbackImageName)?.withTint(.white)?.resizedImage(to: CGSize(width: iconSize, height: iconSize)) let imageView = UIImageView(image: thumbnail ?? fallbackImage) From b7c6eafa87808eaf37d77233c6edceff28de8983 Mon Sep 17 00:00:00 2001 From: ryanzhao Date: Thu, 30 Sep 2021 14:24:04 +1000 Subject: [PATCH 06/17] fix notification preview type nested transaction crash --- Session/Notifications/AppNotifications.swift | 1 + .../Database/Storage+Contacts.swift | 2 +- SessionMessagingKit/Utilities/OWSPreferences.h | 5 +++++ SessionMessagingKit/Utilities/OWSPreferences.m | 15 +++++++++++---- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/Session/Notifications/AppNotifications.swift b/Session/Notifications/AppNotifications.swift index c482720cd..8199d1b4c 100644 --- a/Session/Notifications/AppNotifications.swift +++ b/Session/Notifications/AppNotifications.swift @@ -181,6 +181,7 @@ public class NotificationPresenter: NSObject, NotificationsProtocol { let senderName = Storage.shared.getContact(with: incomingMessage.authorId, using: transaction)?.displayName(for: context) ?? incomingMessage.authorId let notificationTitle: String? + let previewType = preferences.notificationPreviewType(with: transaction) switch previewType { case .noNameNoPreview: notificationTitle = nil diff --git a/SessionMessagingKit/Database/Storage+Contacts.swift b/SessionMessagingKit/Database/Storage+Contacts.swift index 5581de050..3591d4d5e 100644 --- a/SessionMessagingKit/Database/Storage+Contacts.swift +++ b/SessionMessagingKit/Database/Storage+Contacts.swift @@ -25,8 +25,8 @@ extension Storage { @objc(setContact:usingTransaction:) public func setContact(_ contact: Contact, using transaction: Any) { - let oldContact = getContact(with: contact.sessionID) let transaction = transaction as! YapDatabaseReadWriteTransaction + let oldContact = getContact(with: contact.sessionID, using: transaction) if contact.sessionID == getUserHexEncodedPublicKey() { contact.isTrusted = true // Always trust ourselves } diff --git a/SessionMessagingKit/Utilities/OWSPreferences.h b/SessionMessagingKit/Utilities/OWSPreferences.h index f69dbb286..8fdafd1b1 100644 --- a/SessionMessagingKit/Utilities/OWSPreferences.h +++ b/SessionMessagingKit/Utilities/OWSPreferences.h @@ -3,6 +3,10 @@ // #import +#import +#import +#import +#import NS_ASSUME_NONNULL_BEGIN @@ -47,6 +51,7 @@ extern NSString *const OWSPreferencesCallLoggingDidChangeNotification; - (void)setScreenSecurity:(BOOL)flag; - (NotificationType)notificationPreviewType; +- (NotificationType)notificationPreviewTypeWithTransaction:(YapDatabaseReadTransaction *)transaction; - (void)setNotificationPreviewType:(NotificationType)type; - (NSString *)nameForNotificationPreviewType:(NotificationType)notificationType; diff --git a/SessionMessagingKit/Utilities/OWSPreferences.m b/SessionMessagingKit/Utilities/OWSPreferences.m index 645b73a02..29def0003 100644 --- a/SessionMessagingKit/Utilities/OWSPreferences.m +++ b/SessionMessagingKit/Utilities/OWSPreferences.m @@ -3,10 +3,6 @@ // #import "OWSPreferences.h" -#import -#import -#import -#import NS_ASSUME_NONNULL_BEGIN @@ -384,6 +380,17 @@ NSString *const OWSPreferencesKeySystemCallLogEnabled = @"OWSPreferencesKeySyste } } +- (NotificationType)notificationPreviewTypeWithTransaction:(YapDatabaseReadTransaction *)transaction +{ + NSNumber *preference = [self tryGetValueForKey:OWSPreferencesKeyNotificationPreviewType transaction:transaction]; + + if (preference) { + return [preference unsignedIntegerValue]; + } else { + return NotificationNamePreview; + } +} + - (NSString *)nameForNotificationPreviewType:(NotificationType)notificationType { switch (notificationType) { From c33630c1d1dc26e55bbaa475449de879f4ea295a Mon Sep 17 00:00:00 2001 From: ryanzhao Date: Thu, 30 Sep 2021 14:31:14 +1000 Subject: [PATCH 07/17] don't wait for 5s before firing a message notification --- Session/Notifications/UserNotificationsAdaptee.swift | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/Session/Notifications/UserNotificationsAdaptee.swift b/Session/Notifications/UserNotificationsAdaptee.swift index 45b9c2a5c..8d8b6ec21 100644 --- a/Session/Notifications/UserNotificationsAdaptee.swift +++ b/Session/Notifications/UserNotificationsAdaptee.swift @@ -108,15 +108,6 @@ extension UserNotificationPresenterAdaptee: NotificationPresenterAdaptee { cancelNotification(identifier: notificationIdentifier) } - let trigger: UNNotificationTrigger? - let checkForCancel = category == .incomingMessage - if checkForCancel { - assert(userInfo[AppNotificationUserInfoKey.threadId] != nil) - trigger = UNTimeIntervalNotificationTrigger(timeInterval: kNotificationDelayForRemoteRead, repeats: false) - } else { - trigger = nil - } - if shouldPresentNotification(category: category, userInfo: userInfo) { if let displayableTitle = title?.filterForDisplay { content.title = displayableTitle @@ -129,7 +120,7 @@ extension UserNotificationPresenterAdaptee: NotificationPresenterAdaptee { Logger.debug("supressing notification body") } - let request = UNNotificationRequest(identifier: notificationIdentifier, content: content, trigger: trigger) + let request = UNNotificationRequest(identifier: notificationIdentifier, content: content, trigger: nil) Logger.debug("presenting notification with identifier: \(notificationIdentifier)") notificationCenter.add(request) From 7aa751ca45ad17a93647c5d5530b1ea0937bf90f Mon Sep 17 00:00:00 2001 From: ryanzhao Date: Fri, 1 Oct 2021 09:18:40 +1000 Subject: [PATCH 08/17] share log files in settings vc --- Session.xcodeproj/project.pbxproj | 4 ++ Session/Meta/AppEnvironment.swift | 11 +++ .../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/si.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 + Session/Settings/SettingsVC.swift | 19 +++++- Session/Settings/ShareLogsModal.swift | 68 +++++++++++++++++++ 26 files changed, 167 insertions(+), 1 deletion(-) create mode 100644 Session/Settings/ShareLogsModal.swift diff --git a/Session.xcodeproj/project.pbxproj b/Session.xcodeproj/project.pbxproj index 3bc7bd3d4..d2a18306b 100644 --- a/Session.xcodeproj/project.pbxproj +++ b/Session.xcodeproj/project.pbxproj @@ -138,6 +138,7 @@ 76EB054018170B33006006FC /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 76EB03C318170B33006006FC /* AppDelegate.m */; }; 7B4C75CB26B37E0F0000AC89 /* UnsendRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B4C75CA26B37E0F0000AC89 /* UnsendRequest.swift */; }; 7B4C75CD26BB92060000AC89 /* DeletedMessageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B4C75CC26BB92060000AC89 /* DeletedMessageView.swift */; }; + 7B7CB18B270591630079FF93 /* ShareLogsModal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B7CB18A270591630079FF93 /* ShareLogsModal.swift */; }; 7BC01A3E241F40AB00BC7C55 /* NotificationServiceExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BC01A3D241F40AB00BC7C55 /* NotificationServiceExtension.swift */; }; 7BC01A42241F40AB00BC7C55 /* SessionNotificationServiceExtension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 7BC01A3B241F40AB00BC7C55 /* SessionNotificationServiceExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 7BDCFC08242186E700641C39 /* NotificationServiceExtensionContext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BDCFC07242186E700641C39 /* NotificationServiceExtensionContext.swift */; }; @@ -1103,6 +1104,7 @@ 7B2DB2AD26F1B0FF0035B509 /* si */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = si; path = si.lproj/Localizable.strings; sourceTree = ""; }; 7B4C75CA26B37E0F0000AC89 /* UnsendRequest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UnsendRequest.swift; sourceTree = ""; }; 7B4C75CC26BB92060000AC89 /* DeletedMessageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeletedMessageView.swift; sourceTree = ""; }; + 7B7CB18A270591630079FF93 /* ShareLogsModal.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareLogsModal.swift; sourceTree = ""; }; 7BC01A3B241F40AB00BC7C55 /* SessionNotificationServiceExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = SessionNotificationServiceExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; }; 7BC01A3D241F40AB00BC7C55 /* NotificationServiceExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationServiceExtension.swift; sourceTree = ""; }; 7BC01A3F241F40AB00BC7C55 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -2772,6 +2774,7 @@ B886B4A62398B23E00211ABE /* QRCodeVC.swift */, B86BD08523399CEF000F5AE3 /* SeedModal.swift */, B8CCF6422397711F0091D419 /* SettingsVC.swift */, + 7B7CB18A270591630079FF93 /* ShareLogsModal.swift */, ); path = Settings; sourceTree = ""; @@ -4767,6 +4770,7 @@ 3496955D219B605E00DCFE74 /* PhotoCollectionPickerController.swift in Sources */, 34B0796D1FCF46B100E248C2 /* MainAppContext.m in Sources */, 34A8B3512190A40E00218A25 /* MediaAlbumView.swift in Sources */, + 7B7CB18B270591630079FF93 /* ShareLogsModal.swift in Sources */, 4C4AEC4520EC343B0020E72B /* DismissableTextField.swift in Sources */, 3496955E219B605E00DCFE74 /* PhotoLibrary.swift in Sources */, C3A76A8D25DB83F90074CB90 /* PermissionMissingModal.swift in Sources */, diff --git a/Session/Meta/AppEnvironment.swift b/Session/Meta/AppEnvironment.swift index 2aa581a91..805df0d81 100644 --- a/Session/Meta/AppEnvironment.swift +++ b/Session/Meta/AppEnvironment.swift @@ -36,6 +36,9 @@ import SignalUtilitiesKit @objc public var backup: OWSBackup + + @objc + public var fileLogger: DDFileLogger // Stored properties cannot be marked as `@available`, only classes and functions. // Instead, store a private `Any` and wrap it with a public `@available` getter @@ -56,6 +59,7 @@ import SignalUtilitiesKit self.backup = OWSBackup() self.backupLazyRestore = BackupLazyRestore() self._userNotificationActionHandler = UserNotificationActionHandler() + self.fileLogger = DDFileLogger() super.init() @@ -66,5 +70,12 @@ import SignalUtilitiesKit public func setup() { // Hang certain singletons on SSKEnvironment too. SSKEnvironment.shared.notificationsManager = notificationPresenter + setupLogFiles() + } + + private func setupLogFiles() { + fileLogger.rollingFrequency = kDayInterval // Refresh everyday + fileLogger.logFileManager.maximumNumberOfLogFiles = 3 // Save 3 days' log files + DDLog.add(fileLogger) } } diff --git a/Session/Meta/Translations/de.lproj/Localizable.strings b/Session/Meta/Translations/de.lproj/Localizable.strings index 50b71fb77..75a37c6a9 100644 --- a/Session/Meta/Translations/de.lproj/Localizable.strings +++ b/Session/Meta/Translations/de.lproj/Localizable.strings @@ -538,6 +538,8 @@ "modal_link_previews_title" = "Link-Vorschau aktivieren?"; "modal_link_previews_explanation" = "Das Aktivieren von Link-Vorschauen zeigt Vorschaubilder für URLs, die Sie senden und empfangen. Dies kann nützlich sein, aber Session muss verlinkte Webseiten kontaktieren, um Vorschaubilder zu generieren. Du kannst die Link-Vorschau in den Session-Einstellungen immer deaktivieren."; "modal_link_previews_button_title" = "Aktivieren"; +"modal_share_logs_title" = "Share Logs"; +"modal_share_logs_explanation" = "Would you like to export your application logs to be able to share for troubleshooting?"; "vc_share_title" = "Mit Session teilen"; "vc_share_loading_message" = "Anlagen werden vorbereitet..."; "vc_share_sending_message" = "Wird gesendet ..."; @@ -545,6 +547,7 @@ "vc_conversation_settings_invite_button_title" = "Mitglieder hinzufügen"; "vc_settings_faq_button_title" = "FAQ"; "vc_settings_survey_button_title" = "Feedback / Survey"; +"vc_settings_support_button_title" = "Support"; "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 d5f10cc5b..86277878a 100644 --- a/Session/Meta/Translations/en.lproj/Localizable.strings +++ b/Session/Meta/Translations/en.lproj/Localizable.strings @@ -538,6 +538,8 @@ "modal_link_previews_title" = "Enable Link Previews?"; "modal_link_previews_explanation" = "Enabling link previews will show previews for URLs you send and receive. This can be useful, but Session will need to contact linked websites to generate previews. You can always disable link previews in Session's settings."; "modal_link_previews_button_title" = "Enable"; +"modal_share_logs_title" = "Share Logs"; +"modal_share_logs_explanation" = "Would you like to export your application logs to be able to share for troubleshooting?"; "vc_share_title" = "Share to Session"; "vc_share_loading_message" = "Preparing attachments..."; "vc_share_sending_message" = "Sending..."; @@ -545,6 +547,7 @@ "vc_conversation_settings_invite_button_title" = "Add Members"; "vc_settings_faq_button_title" = "FAQ"; "vc_settings_survey_button_title" = "Feedback / Survey"; +"vc_settings_support_button_title" = "Support"; "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 4317d8ca7..11726392c 100644 --- a/Session/Meta/Translations/es.lproj/Localizable.strings +++ b/Session/Meta/Translations/es.lproj/Localizable.strings @@ -538,6 +538,8 @@ "modal_link_previews_title" = "¿Habilitar Previsualizaciones de Enlace?"; "modal_link_previews_explanation" = "Activar vista previa de enlaces mostrará las vistas previas para las URL que envíe y reciba. Esto puede ser útil, pero Session tendrá que ponerse en contacto con los sitios web enlazados para generar vistas previas. Siempre puedes desactivar las vistas previas de enlaces en la configuración de Session."; "modal_link_previews_button_title" = "Activar"; +"modal_share_logs_title" = "Share Logs"; +"modal_share_logs_explanation" = "Would you like to export your application logs to be able to share for troubleshooting?"; "vc_share_title" = "Compartir en Session"; "vc_share_loading_message" = "Preparando archivos adjuntos..."; "vc_share_sending_message" = "Enviando..."; @@ -545,6 +547,7 @@ "vc_conversation_settings_invite_button_title" = "Añadir Miembros"; "vc_settings_faq_button_title" = "FAQ"; "vc_settings_survey_button_title" = "Feedback / Survey"; +"vc_settings_support_button_title" = "Support"; "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 7f2645bbe..eb1e06929 100644 --- a/Session/Meta/Translations/fa.lproj/Localizable.strings +++ b/Session/Meta/Translations/fa.lproj/Localizable.strings @@ -538,6 +538,8 @@ "modal_link_previews_title" = "فعال‌سازی پیش‌نمایش لینک؟"; "modal_link_previews_explanation" = "Enabling link previews will show previews for URLs you send and receive. This can be useful, but Session will need to contact linked websites to generate previews. You can always disable link previews in Session's settings."; "modal_link_previews_button_title" = "فعال سازی"; +"modal_share_logs_title" = "Share Logs"; +"modal_share_logs_explanation" = "Would you like to export your application logs to be able to share for troubleshooting?"; "vc_share_title" = "اشتراک گذاری با Session"; "vc_share_loading_message" = "آماده سازی پیوست‌ها..."; "vc_share_sending_message" = "در حال ارسال..."; @@ -545,6 +547,7 @@ "vc_conversation_settings_invite_button_title" = "Add Members"; "vc_settings_faq_button_title" = "FAQ"; "vc_settings_survey_button_title" = "Feedback / Survey"; +"vc_settings_support_button_title" = "Support"; "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 319c43001..630a92fc6 100644 --- a/Session/Meta/Translations/fi.lproj/Localizable.strings +++ b/Session/Meta/Translations/fi.lproj/Localizable.strings @@ -538,6 +538,8 @@ "modal_link_previews_title" = "Ota linkkien esikatselu käyttöön?"; "modal_link_previews_explanation" = "Enabling link previews will show previews for URLs you send and receive. This can be useful, but Session will need to contact linked websites to generate previews. You can always disable link previews in Session's settings."; "modal_link_previews_button_title" = "Ota käyttöön"; +"modal_share_logs_title" = "Share Logs"; +"modal_share_logs_explanation" = "Would you like to export your application logs to be able to share for troubleshooting?"; "vc_share_title" = "Jaa Sessioniin"; "vc_share_loading_message" = "Valmistellaan liitteitä..."; "vc_share_sending_message" = "Lähetetään..."; @@ -545,6 +547,7 @@ "vc_conversation_settings_invite_button_title" = "Lisää jäseniä"; "vc_settings_faq_button_title" = "FAQ"; "vc_settings_survey_button_title" = "Feedback / Survey"; +"vc_settings_support_button_title" = "Support"; "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 81a7d62d9..3904fc388 100644 --- a/Session/Meta/Translations/fr.lproj/Localizable.strings +++ b/Session/Meta/Translations/fr.lproj/Localizable.strings @@ -538,6 +538,8 @@ "modal_link_previews_title" = "Activer les aperçus de lien?"; "modal_link_previews_explanation" = "L'activation des aperçus de lien affichera des aperçus pour les URL que vous envoyez et recevez. Cela peut être utile, mais Session devra contacter les sites Web liés pour générer des aperçus. Vous pouvez toujours désactiver les aperçus de lien dans les paramètres de Session."; "modal_link_previews_button_title" = "Activer"; +"modal_share_logs_title" = "Share Logs"; +"modal_share_logs_explanation" = "Would you like to export your application logs to be able to share for troubleshooting?"; "vc_share_title" = "Partager en Session"; "vc_share_loading_message" = "Préparation des pièces jointes ..."; "vc_share_sending_message" = "Envoi..."; @@ -545,6 +547,7 @@ "vc_conversation_settings_invite_button_title" = "Ajouter des membres"; "vc_settings_faq_button_title" = "FAQ"; "vc_settings_survey_button_title" = "Feedback / Survey"; +"vc_settings_support_button_title" = "Support"; "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 01a613910..5fb80be9c 100644 --- a/Session/Meta/Translations/hi.lproj/Localizable.strings +++ b/Session/Meta/Translations/hi.lproj/Localizable.strings @@ -538,6 +538,8 @@ "modal_link_previews_title" = "लिंक पूर्वावलोकन सक्षम करें?"; "modal_link_previews_explanation" = "लिंक पूर्वावलोकन सक्षम करने से आपके द्वारा भेजे और प्राप्त किए जाने वाले URL के पूर्वावलोकन दिखाई देंगे. यह उपयोगी हो सकता है, लेकिन Session को पूर्वावलोकन उत्पन्न करने के लिए लिंक की गई वेबसाइटों से संपर्क करने की आवश्यकता होगी। आप कभी भी Session की सेटिंग में लिंक पूर्वावलोकन अक्षम कर सकते हैं।"; "modal_link_previews_button_title" = "सक्षम करें"; +"modal_share_logs_title" = "Share Logs"; +"modal_share_logs_explanation" = "Would you like to export your application logs to be able to share for troubleshooting?"; "vc_share_title" = "सत्र में साझा करें"; "vc_share_loading_message" = "अटैचमेंट तैयार किए जा रहे हैं..."; "vc_share_sending_message" = "भेजा जा रहा है..."; @@ -545,6 +547,7 @@ "vc_conversation_settings_invite_button_title" = "सदस्य जोड़ें"; "vc_settings_faq_button_title" = "FAQ"; "vc_settings_survey_button_title" = "Feedback / Survey"; +"vc_settings_support_button_title" = "Support"; "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 67906feec..f00a6d2b1 100644 --- a/Session/Meta/Translations/hr.lproj/Localizable.strings +++ b/Session/Meta/Translations/hr.lproj/Localizable.strings @@ -538,6 +538,8 @@ "modal_link_previews_title" = "Omogući preglede poveznica?"; "modal_link_previews_explanation" = "Omogućavanjem pregleda poveznica prikazat će se pregledi za URL-ove koje šaljete i primate. To može biti korisno, ali Session će trebati kontaktirati povezane web stranice kako bi generirao preglede. Uvijek možete onemogućiti preglede poveznica u postavkama Session-a."; "modal_link_previews_button_title" = "Uključi"; +"modal_share_logs_title" = "Share Logs"; +"modal_share_logs_explanation" = "Would you like to export your application logs to be able to share for troubleshooting?"; "vc_share_title" = "Podijeli sa Session-om"; "vc_share_loading_message" = "Priprema privitaka..."; "vc_share_sending_message" = "Slanje..."; @@ -545,6 +547,7 @@ "vc_conversation_settings_invite_button_title" = "Dodaj članove"; "vc_settings_faq_button_title" = "FAQ"; "vc_settings_survey_button_title" = "Feedback / Survey"; +"vc_settings_support_button_title" = "Support"; "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 24b7fbfb7..27f04eb17 100644 --- a/Session/Meta/Translations/id-ID.lproj/Localizable.strings +++ b/Session/Meta/Translations/id-ID.lproj/Localizable.strings @@ -538,6 +538,8 @@ "modal_link_previews_title" = "Enable Link Previews?"; "modal_link_previews_explanation" = "Enabling link previews will show previews for URLs you send and receive. This can be useful, but Session will need to contact linked websites to generate previews. You can always disable link previews in Session's settings."; "modal_link_previews_button_title" = "Enable"; +"modal_share_logs_title" = "Share Logs"; +"modal_share_logs_explanation" = "Would you like to export your application logs to be able to share for troubleshooting?"; "vc_share_title" = "Share to Session"; "vc_share_loading_message" = "Preparing attachments..."; "vc_share_sending_message" = "Sending..."; @@ -545,6 +547,7 @@ "vc_conversation_settings_invite_button_title" = "Add Members"; "vc_settings_faq_button_title" = "FAQ"; "vc_settings_survey_button_title" = "Feedback / Survey"; +"vc_settings_support_button_title" = "Support"; "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 fdce7ea5a..8d98bbe76 100644 --- a/Session/Meta/Translations/it.lproj/Localizable.strings +++ b/Session/Meta/Translations/it.lproj/Localizable.strings @@ -538,6 +538,8 @@ "modal_link_previews_title" = "Abilitare Anteprima Link?"; "modal_link_previews_explanation" = "Abilitando le anteprime dei collegamenti Session mostrerà le anteprime degli URL che invii e ricevi. Questo può essere utile, ma Session dovrà contattare i siti web collegati per generare le anteprime. Puoi sempre disabilitare le anteprime dei link nelle impostazioni di Session."; "modal_link_previews_button_title" = "Abilita"; +"modal_share_logs_title" = "Share Logs"; +"modal_share_logs_explanation" = "Would you like to export your application logs to be able to share for troubleshooting?"; "vc_share_title" = "Condividi con Session"; "vc_share_loading_message" = "Preparazione allegati..."; "vc_share_sending_message" = "Invio..."; @@ -545,6 +547,7 @@ "vc_conversation_settings_invite_button_title" = "Aggiungi membri"; "vc_settings_faq_button_title" = "FAQ"; "vc_settings_survey_button_title" = "Feedback / Survey"; +"vc_settings_support_button_title" = "Support"; "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 b5392771a..aa668b546 100644 --- a/Session/Meta/Translations/ja.lproj/Localizable.strings +++ b/Session/Meta/Translations/ja.lproj/Localizable.strings @@ -538,6 +538,8 @@ "modal_link_previews_title" = "リンクプレビューを有効にしますか?"; "modal_link_previews_explanation" = "リンクプレビューを有効すると、URLを送受信する場合にプレビューが表示されます。これは便利ですが、プレビューを作成するのにSessionはそのウェブサイトに接続する必要があります。Sessionの設定から、リンクプレビューをいつでも無効にできます。"; "modal_link_previews_button_title" = "有効にする"; +"modal_share_logs_title" = "Share Logs"; +"modal_share_logs_explanation" = "Would you like to export your application logs to be able to share for troubleshooting?"; "vc_share_title" = "Sessionと共有"; "vc_share_loading_message" = "添付ファイルを準備しています..."; "vc_share_sending_message" = "送信中…"; @@ -545,6 +547,7 @@ "vc_conversation_settings_invite_button_title" = "メンバーを追加する"; "vc_settings_faq_button_title" = "FAQ"; "vc_settings_survey_button_title" = "Feedback / Survey"; +"vc_settings_support_button_title" = "Support"; "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 c47613ed3..256148640 100644 --- a/Session/Meta/Translations/nl.lproj/Localizable.strings +++ b/Session/Meta/Translations/nl.lproj/Localizable.strings @@ -538,6 +538,8 @@ "modal_link_previews_title" = "Linkvoorbeeld inschakelen?"; "modal_link_previews_explanation" = "Link previews inschakelen zal previews tonen voor URLs die u verstuurt en ontvangt. Dit kan nuttig zijn, maar Session moet contact opnemen met gekoppelde websites om previews te genereren. U kunt links altijd uitschakelen in de Session’s-instellingen."; "modal_link_previews_button_title" = "Inschakelen"; +"modal_share_logs_title" = "Share Logs"; +"modal_share_logs_explanation" = "Would you like to export your application logs to be able to share for troubleshooting?"; "vc_share_title" = "Delen naar de Session"; "vc_share_loading_message" = "Bijlagen voorbereiden..."; "vc_share_sending_message" = "Aan het verzenden..."; @@ -545,6 +547,7 @@ "vc_conversation_settings_invite_button_title" = "Voeg deelnemers toe"; "vc_settings_faq_button_title" = "FAQ"; "vc_settings_survey_button_title" = "Feedback / Survey"; +"vc_settings_support_button_title" = "Support"; "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 560858e0f..bcfe6f24f 100644 --- a/Session/Meta/Translations/pl.lproj/Localizable.strings +++ b/Session/Meta/Translations/pl.lproj/Localizable.strings @@ -538,6 +538,8 @@ "modal_link_previews_title" = "Włączyć podgląd linków?"; "modal_link_previews_explanation" = "Włączanie podglądów linków wyświetli podgląd dla adresów URL które wysyłasz i otrzymujesz. Może to być użyteczne, ale Session będzie musiał się połączyć ze stronami których linki wysyłasz aby wygenerować podgląd. Możesz zawsze wyłączyć podgląd linków w ustawieniach Session."; "modal_link_previews_button_title" = "Włącz"; +"modal_share_logs_title" = "Share Logs"; +"modal_share_logs_explanation" = "Would you like to export your application logs to be able to share for troubleshooting?"; "vc_share_title" = "Udostępnij w Session"; "vc_share_loading_message" = "Przygotowywanie załączników..."; "vc_share_sending_message" = "Wysyłanie..."; @@ -545,6 +547,7 @@ "vc_conversation_settings_invite_button_title" = "Dodaj użytkowników"; "vc_settings_faq_button_title" = "FAQ"; "vc_settings_survey_button_title" = "Feedback / Survey"; +"vc_settings_support_button_title" = "Support"; "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 e315fbc08..d01dc8ae8 100644 --- a/Session/Meta/Translations/pt_BR.lproj/Localizable.strings +++ b/Session/Meta/Translations/pt_BR.lproj/Localizable.strings @@ -538,6 +538,8 @@ "modal_link_previews_title" = "Ativar pré-visualizações de link?"; "modal_link_previews_explanation" = "Ativar a pré-visualização de links irá mostrar as URLs que você receber e enviar. Isto pode ser útil, o Session precisa se conectar aos sites vinculados gerar as prévias. Você poderá desabiliatar esta opção nas configurações do Session."; "modal_link_previews_button_title" = "Ativar"; +"modal_share_logs_title" = "Share Logs"; +"modal_share_logs_explanation" = "Would you like to export your application logs to be able to share for troubleshooting?"; "vc_share_title" = "Compartilhar no Session"; "vc_share_loading_message" = "Preparando anexos..."; "vc_share_sending_message" = "Enviando..."; @@ -545,6 +547,7 @@ "vc_conversation_settings_invite_button_title" = "Adicionar Membros"; "vc_settings_faq_button_title" = "FAQ"; "vc_settings_survey_button_title" = "Feedback / Survey"; +"vc_settings_support_button_title" = "Support"; "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 56b90b7ef..7638277bf 100644 --- a/Session/Meta/Translations/ru.lproj/Localizable.strings +++ b/Session/Meta/Translations/ru.lproj/Localizable.strings @@ -538,6 +538,8 @@ "modal_link_previews_title" = "Включить предварительный просмотр ссылок?"; "modal_link_previews_explanation" = "Включение предпросмотра ссылок покажет превью для отправляемых и получаемых ссылок. Это может быть полезно, но Session нужно будет соединиться с сайтами, связанными с ссылками, чтобы сгенерировать предпросмотр. Вы всегда можете отключить предпросмотр ссылок в настройках Session."; "modal_link_previews_button_title" = "Включить"; +"modal_share_logs_title" = "Share Logs"; +"modal_share_logs_explanation" = "Would you like to export your application logs to be able to share for troubleshooting?"; "vc_share_title" = "Поделиться в Session"; "vc_share_loading_message" = "Подготовка вложений..."; "vc_share_sending_message" = "Отправка..."; @@ -545,6 +547,7 @@ "vc_conversation_settings_invite_button_title" = "Добавить участников"; "vc_settings_faq_button_title" = "FAQ"; "vc_settings_survey_button_title" = "Feedback / Survey"; +"vc_settings_support_button_title" = "Support"; "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/si.lproj/Localizable.strings b/Session/Meta/Translations/si.lproj/Localizable.strings index d5f10cc5b..86277878a 100644 --- a/Session/Meta/Translations/si.lproj/Localizable.strings +++ b/Session/Meta/Translations/si.lproj/Localizable.strings @@ -538,6 +538,8 @@ "modal_link_previews_title" = "Enable Link Previews?"; "modal_link_previews_explanation" = "Enabling link previews will show previews for URLs you send and receive. This can be useful, but Session will need to contact linked websites to generate previews. You can always disable link previews in Session's settings."; "modal_link_previews_button_title" = "Enable"; +"modal_share_logs_title" = "Share Logs"; +"modal_share_logs_explanation" = "Would you like to export your application logs to be able to share for troubleshooting?"; "vc_share_title" = "Share to Session"; "vc_share_loading_message" = "Preparing attachments..."; "vc_share_sending_message" = "Sending..."; @@ -545,6 +547,7 @@ "vc_conversation_settings_invite_button_title" = "Add Members"; "vc_settings_faq_button_title" = "FAQ"; "vc_settings_survey_button_title" = "Feedback / Survey"; +"vc_settings_support_button_title" = "Support"; "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 f7f2222d1..a576bf501 100644 --- a/Session/Meta/Translations/sk.lproj/Localizable.strings +++ b/Session/Meta/Translations/sk.lproj/Localizable.strings @@ -538,6 +538,8 @@ "modal_link_previews_title" = "Povoliť náhľad odkazov?"; "modal_link_previews_explanation" = "Enabling link previews will show previews for URLs you send and receive. This can be useful, but Session will need to contact linked websites to generate previews. You can always disable link previews in Session's settings."; "modal_link_previews_button_title" = "Povoliť"; +"modal_share_logs_title" = "Share Logs"; +"modal_share_logs_explanation" = "Would you like to export your application logs to be able to share for troubleshooting?"; "vc_share_title" = "Share to Session"; "vc_share_loading_message" = "Pripravujú sa prílohy..."; "vc_share_sending_message" = "Odosiela sa..."; @@ -545,6 +547,7 @@ "vc_conversation_settings_invite_button_title" = "Pridať členov"; "vc_settings_faq_button_title" = "FAQ"; "vc_settings_survey_button_title" = "Feedback / Survey"; +"vc_settings_support_button_title" = "Support"; "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 8a36b41ff..9cb625b39 100644 --- a/Session/Meta/Translations/sv.lproj/Localizable.strings +++ b/Session/Meta/Translations/sv.lproj/Localizable.strings @@ -538,6 +538,8 @@ "modal_link_previews_title" = "Aktivera förhandsgranskningar av länkar?"; "modal_link_previews_explanation" = "Om du aktiverar länkförhandsvisningar visas förhandsvisningar för URL: er du skickar och tar emot. Detta kan vara användbart, men sessionen måste kontakta länkade webbplatser för att generera förhandsvisningar. Du kan alltid inaktivera länkförhandsvisningar i sessionsinställningarna."; "modal_link_previews_button_title" = "Aktivera"; +"modal_share_logs_title" = "Share Logs"; +"modal_share_logs_explanation" = "Would you like to export your application logs to be able to share for troubleshooting?"; "vc_share_title" = "Dela i Session"; "vc_share_loading_message" = "Förbereder bilagor..."; "vc_share_sending_message" = "Skickar..."; @@ -545,6 +547,7 @@ "vc_conversation_settings_invite_button_title" = "Lägg till medlemmar"; "vc_settings_faq_button_title" = "FAQ"; "vc_settings_survey_button_title" = "Feedback / Survey"; +"vc_settings_support_button_title" = "Support"; "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 aeb9632f3..154ddbf7f 100644 --- a/Session/Meta/Translations/th.lproj/Localizable.strings +++ b/Session/Meta/Translations/th.lproj/Localizable.strings @@ -538,6 +538,8 @@ "modal_link_previews_title" = "เปิดใช้งานการแสดงตัวอย่างลิงค์"; "modal_link_previews_explanation" = "การเปิดใช้งานการแสดงตัวอย่างลิงค์จะแสดงตัวอย่างสำหรับ URL ที่คุณส่งและรับ สิ่งนี้มีประโยชน์ แต่Sessionจะต้องติดต่อเว็บไซต์ที่เชื่อมโยงเพื่อสร้างตัวอย่าง คุณสามารถปิดการแสดงตัวอย่างลิงก์ได้ตลอดเวลาในการตั้งค่าของSession"; "modal_link_previews_button_title" = "เปิดใช้งาน"; +"modal_share_logs_title" = "Share Logs"; +"modal_share_logs_explanation" = "Would you like to export your application logs to be able to share for troubleshooting?"; "vc_share_title" = "เชิญมาใช้ Session"; "vc_share_loading_message" = "รวบรวมสิ่งแนบ..."; "vc_share_sending_message" = "กำลังส่ง..."; @@ -545,6 +547,7 @@ "vc_conversation_settings_invite_button_title" = "เพิ่มสมาชิก"; "vc_settings_faq_button_title" = "FAQ"; "vc_settings_survey_button_title" = "Feedback / Survey"; +"vc_settings_support_button_title" = "Support"; "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 de5deaede..fe322da91 100644 --- a/Session/Meta/Translations/vi-VN.lproj/Localizable.strings +++ b/Session/Meta/Translations/vi-VN.lproj/Localizable.strings @@ -538,6 +538,8 @@ "modal_link_previews_title" = "Enable Link Previews?"; "modal_link_previews_explanation" = "Enabling link previews will show previews for URLs you send and receive. This can be useful, but Session will need to contact linked websites to generate previews. You can always disable link previews in Session's settings."; "modal_link_previews_button_title" = "Enable"; +"modal_share_logs_title" = "Share Logs"; +"modal_share_logs_explanation" = "Would you like to export your application logs to be able to share for troubleshooting?"; "vc_share_title" = "Share to Session"; "vc_share_loading_message" = "Preparing attachments..."; "vc_share_sending_message" = "Sending..."; @@ -545,6 +547,7 @@ "vc_conversation_settings_invite_button_title" = "Add Members"; "vc_settings_faq_button_title" = "FAQ"; "vc_settings_survey_button_title" = "Feedback / Survey"; +"vc_settings_support_button_title" = "Support"; "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 e337ac3bf..25e63d471 100644 --- a/Session/Meta/Translations/zh-Hant.lproj/Localizable.strings +++ b/Session/Meta/Translations/zh-Hant.lproj/Localizable.strings @@ -538,6 +538,8 @@ "modal_link_previews_title" = "是否要啟用連結預覽?"; "modal_link_previews_explanation" = "啟用連結預覽將會讓您送出與接收的 URLs 啟用預覽,這是一項好用的功能,但是 Session 會需要連結這些網站來產生預覽,您可以隨時關閉連結預覽功能。"; "modal_link_previews_button_title" = "啟用"; +"modal_share_logs_title" = "Share Logs"; +"modal_share_logs_explanation" = "Would you like to export your application logs to be able to share for troubleshooting?"; "vc_share_title" = "分享至 Session"; "vc_share_loading_message" = "準備附件中⋯"; "vc_share_sending_message" = "傳送中⋯"; @@ -545,6 +547,7 @@ "vc_conversation_settings_invite_button_title" = "新增成員"; "vc_settings_faq_button_title" = "FAQ"; "vc_settings_survey_button_title" = "Feedback / Survey"; +"vc_settings_support_button_title" = "Support"; "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 2e01912ef..810a534ad 100644 --- a/Session/Meta/Translations/zh_CN.lproj/Localizable.strings +++ b/Session/Meta/Translations/zh_CN.lproj/Localizable.strings @@ -538,6 +538,8 @@ "modal_link_previews_title" = "是否启用链接预览?"; "modal_link_previews_explanation" = "链接预览将为您发送或收到的URL生成预览内容。 该功能非常实用,但Session需要访问该链接指向的网站以生成预览。您可以随后在会话设置中禁用该功能。"; "modal_link_previews_button_title" = "启用"; +"modal_share_logs_title" = "Share Logs"; +"modal_share_logs_explanation" = "Would you like to export your application logs to be able to share for troubleshooting?"; "vc_share_title" = "分享到 Session"; "vc_share_loading_message" = "正在准备附件......"; "vc_share_sending_message" = "正在发送…"; @@ -545,6 +547,7 @@ "vc_conversation_settings_invite_button_title" = "添加成员"; "vc_settings_faq_button_title" = "FAQ"; "vc_settings_survey_button_title" = "Feedback / Survey"; +"vc_settings_support_button_title" = "Support"; "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/Settings/SettingsVC.swift b/Session/Settings/SettingsVC.swift index 45eb282c3..53febc939 100644 --- a/Session/Settings/SettingsVC.swift +++ b/Session/Settings/SettingsVC.swift @@ -1,3 +1,4 @@ +import UIKit final class SettingsVC : BaseVC, AvatarViewHelperDelegate { private var profilePictureToBeUploaded: UIImage? @@ -90,6 +91,15 @@ final class SettingsVC : BaseVC, AvatarViewHelperDelegate { return result }() + private lazy var supportButton: UIButton = { + let result = UIButton() + result.setTitle(NSLocalizedString("vc_settings_support_button_title", comment: ""), for: UIControl.State.normal) + result.setTitleColor(Colors.text, for: UIControl.State.normal) + result.titleLabel!.font = .boldSystemFont(ofSize: Values.smallFontSize) + result.addTarget(self, action: #selector(shareLogs), for: UIControl.Event.touchUpInside) + return result + }() + private lazy var helpTranslateButton: UIButton = { let result = UIButton() result.setTitle(NSLocalizedString("vc_settings_help_us_translate_button_title", comment: ""), for: UIControl.State.normal) @@ -187,7 +197,7 @@ final class SettingsVC : BaseVC, AvatarViewHelperDelegate { logoContainer.pin(.bottom, to: .bottom, of: logoImageView) logoImageView.centerXAnchor.constraint(equalTo: logoContainer.centerXAnchor, constant: -2).isActive = true // Main stack view - let stackView = UIStackView(arrangedSubviews: [ topStackView, settingButtonsStackView, inviteButton, faqButton, surveyButton, helpTranslateButton, logoContainer, versionLabel ]) + let stackView = UIStackView(arrangedSubviews: [ topStackView, settingButtonsStackView, inviteButton, faqButton, surveyButton, supportButton, helpTranslateButton, logoContainer, versionLabel ]) stackView.axis = .vertical stackView.spacing = Values.largeSpacing stackView.alignment = .fill @@ -487,6 +497,13 @@ final class SettingsVC : BaseVC, AvatarViewHelperDelegate { UIApplication.shared.open(url) } + @objc private func shareLogs() { + let shareLogsModal = ShareLogsModal() + shareLogsModal.modalPresentationStyle = .overFullScreen + shareLogsModal.modalTransitionStyle = .crossDissolve + present(shareLogsModal, animated: true, completion: nil) + } + @objc private func helpTranslate() { let url = URL(string: "https://crowdin.com/project/session-ios")! UIApplication.shared.open(url) diff --git a/Session/Settings/ShareLogsModal.swift b/Session/Settings/ShareLogsModal.swift new file mode 100644 index 000000000..9e8408528 --- /dev/null +++ b/Session/Settings/ShareLogsModal.swift @@ -0,0 +1,68 @@ +import SignalUtilitiesKit + +final class ShareLogsModal : Modal { + + // MARK: Lifecycle + init() { + super.init(nibName: nil, bundle: nil) + } + + override init(nibName: String?, bundle: Bundle?) { + preconditionFailure("Use init(url:) instead.") + } + + required init?(coder: NSCoder) { + preconditionFailure("Use init(url:) instead.") + } + + override func populateContentView() { + // Title + let titleLabel = UILabel() + titleLabel.textColor = Colors.text + titleLabel.font = .boldSystemFont(ofSize: Values.largeFontSize) + titleLabel.text = NSLocalizedString("modal_share_logs_title", comment: "") + titleLabel.textAlignment = .center + // Message + let messageLabel = UILabel() + messageLabel.textColor = Colors.text.withAlphaComponent(Values.mediumOpacity) + messageLabel.font = .systemFont(ofSize: Values.smallFontSize) + messageLabel.text = NSLocalizedString("modal_share_logs_explanation", comment: "") + messageLabel.numberOfLines = 0 + messageLabel.lineBreakMode = .byWordWrapping + messageLabel.textAlignment = .center + // Open button + let shareButton = UIButton() + shareButton.set(.height, to: Values.mediumButtonHeight) + shareButton.layer.cornerRadius = Modal.buttonCornerRadius + shareButton.backgroundColor = Colors.buttonBackground + shareButton.titleLabel!.font = .systemFont(ofSize: Values.smallFontSize) + shareButton.setTitleColor(Colors.text, for: UIControl.State.normal) + shareButton.setTitle(NSLocalizedString("share", comment: ""), for: UIControl.State.normal) + shareButton.addTarget(self, action: #selector(shareLogs), for: UIControl.Event.touchUpInside) + // Button stack view + let buttonStackView = UIStackView(arrangedSubviews: [ cancelButton, shareButton ]) + buttonStackView.axis = .horizontal + buttonStackView.spacing = Values.mediumSpacing + buttonStackView.distribution = .fillEqually + // Main stack view + let mainStackView = UIStackView(arrangedSubviews: [ titleLabel, messageLabel, buttonStackView ]) + mainStackView.axis = .vertical + mainStackView.spacing = Values.largeSpacing + 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 shareLogs() { + let logFilePaths = AppEnvironment.shared.fileLogger.logFileManager.sortedLogFilePaths + if let latestLogFilePath = logFilePaths.last { + let latestLogFileURL = URL(fileURLWithPath: latestLogFilePath) + self.dismiss(animated: true, completion: { + AttachmentSharing.showShareUI(for: latestLogFileURL) + }) + } + } +} From 6b81d78d43d59ed227515ac0d068a43174029d2e Mon Sep 17 00:00:00 2001 From: ryanzhao Date: Fri, 1 Oct 2021 09:30:45 +1000 Subject: [PATCH 09/17] fix share screen nav bar UI for iOS 15 --- SessionShareExtension/ThreadPickerVC.swift | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/SessionShareExtension/ThreadPickerVC.swift b/SessionShareExtension/ThreadPickerVC.swift index 939a67594..e718f63e0 100644 --- a/SessionShareExtension/ThreadPickerVC.swift +++ b/SessionShareExtension/ThreadPickerVC.swift @@ -36,6 +36,7 @@ final class ThreadPickerVC : UIViewController, UITableViewDataSource, UITableVie // MARK: Lifecycle override func viewDidLoad() { super.viewDidLoad() + setupNavBar() // Gradient view.backgroundColor = .clear let gradient = Gradients.defaultBackground @@ -68,6 +69,18 @@ final class ThreadPickerVC : UIViewController, UITableViewDataSource, UITableVie reload() } + private func setupNavBar() { + guard let navigationBar = navigationController?.navigationBar else { return } + if #available(iOS 15.0, *) { + let appearance = UINavigationBarAppearance() + appearance.configureWithOpaqueBackground() + appearance.backgroundColor = Colors.navigationBarBackground + appearance.shadowColor = .clear + navigationBar.standardAppearance = appearance; + navigationBar.scrollEdgeAppearance = navigationBar.standardAppearance + } + } + // MARK: Table View Data Source func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return Int(threadCount) From 260f5392839c917cc9700929dfe2bac3b98d9d40 Mon Sep 17 00:00:00 2001 From: ryanzhao Date: Fri, 1 Oct 2021 09:35:14 +1000 Subject: [PATCH 10/17] minor UI fix --- SessionShareExtension/ThreadPickerVC.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/SessionShareExtension/ThreadPickerVC.swift b/SessionShareExtension/ThreadPickerVC.swift index e718f63e0..390639c3e 100644 --- a/SessionShareExtension/ThreadPickerVC.swift +++ b/SessionShareExtension/ThreadPickerVC.swift @@ -75,7 +75,6 @@ final class ThreadPickerVC : UIViewController, UITableViewDataSource, UITableVie let appearance = UINavigationBarAppearance() appearance.configureWithOpaqueBackground() appearance.backgroundColor = Colors.navigationBarBackground - appearance.shadowColor = .clear navigationBar.standardAppearance = appearance; navigationBar.scrollEdgeAppearance = navigationBar.standardAppearance } From 1899a3fe3d29090215e8012bacaa94f36a71d144 Mon Sep 17 00:00:00 2001 From: ryanzhao Date: Fri, 1 Oct 2021 14:44:52 +1000 Subject: [PATCH 11/17] fix sharing not work for session --- SessionShareExtension/ThreadPickerVC.swift | 18 +++++----- .../MediaMessageView.swift | 2 +- .../MessageSender+Convenience.swift | 34 +++++++++++++++++++ 3 files changed, 43 insertions(+), 11 deletions(-) diff --git a/SessionShareExtension/ThreadPickerVC.swift b/SessionShareExtension/ThreadPickerVC.swift index 390639c3e..75355d23a 100644 --- a/SessionShareExtension/ThreadPickerVC.swift +++ b/SessionShareExtension/ThreadPickerVC.swift @@ -121,16 +121,14 @@ final class ThreadPickerVC : UIViewController, UITableViewDataSource, UITableVie } shareVC!.dismiss(animated: true, completion: nil) ModalActivityIndicatorViewController.present(fromViewController: shareVC!, canCancel: false, message: NSLocalizedString("vc_share_sending_message", comment: "")) { activityIndicator in - Storage.write { transaction in - MessageSender.sendNonDurably(message, with: attachments, in: self.selectedThread!, using: transaction).done { [weak self] _ in - guard let self = self else { return } - activityIndicator.dismiss { } - self.shareVC!.shareViewWasCompleted() - }.catch { [weak self] error in - guard let self = self else { return } - activityIndicator.dismiss { } - self.shareVC!.shareViewFailed(error: error) - } + MessageSender.sendNonDurably(message, with: attachments, in: self.selectedThread!).done { [weak self] _ in + guard let self = self else { return } + activityIndicator.dismiss { } + self.shareVC!.shareViewWasCompleted() + }.catch { [weak self] error in + guard let self = self else { return } + activityIndicator.dismiss { } + self.shareVC!.shareViewFailed(error: error) } } } diff --git a/SignalUtilitiesKit/Media Viewing & Editing/MediaMessageView.swift b/SignalUtilitiesKit/Media Viewing & Editing/MediaMessageView.swift index 7c13aae4e..443f5fc80 100644 --- a/SignalUtilitiesKit/Media Viewing & Editing/MediaMessageView.swift +++ b/SignalUtilitiesKit/Media Viewing & Editing/MediaMessageView.swift @@ -269,7 +269,7 @@ public class MediaMessageView: UIView, OWSAudioPlayerDelegate { private func createGenericPreview() { var subviews = [UIView]() - let imageView = createHeroImageView(imageName: "file-thin-black-filled-large") + let imageView = createHeroImageView(imageName: "actionsheet_document_black") subviews.append(imageView) let fileNameLabel = createFileNameLabel() diff --git a/SignalUtilitiesKit/Messaging/Sending & Receiving/MessageSender+Convenience.swift b/SignalUtilitiesKit/Messaging/Sending & Receiving/MessageSender+Convenience.swift index 177cdb65d..3297ce14e 100644 --- a/SignalUtilitiesKit/Messaging/Sending & Receiving/MessageSender+Convenience.swift +++ b/SignalUtilitiesKit/Messaging/Sending & Receiving/MessageSender+Convenience.swift @@ -67,4 +67,38 @@ extension MessageSender { let destination = Message.Destination.from(thread) return MessageSender.send(message, to: destination, using: transaction) } + + public static func sendNonDurably(_ message: VisibleMessage, with attachments: [SignalAttachment], in thread: TSThread) -> Promise { + Storage.writeSync{ transaction in + prep(attachments, for: message, using: transaction) + } + let attachments = message.attachmentIDs.compactMap { TSAttachment.fetch(uniqueId: $0) as? TSAttachmentStream } + let attachmentsToUpload = attachments.filter { !$0.isUploaded } + let attachmentUploadPromises: [Promise] = attachmentsToUpload.map { stream in + let storage = SNMessagingKitConfiguration.shared.storage + if let v2OpenGroup = storage.getV2OpenGroup(for: thread.uniqueId!) { + let (promise, seal) = Promise.pending() + AttachmentUploadJob.upload(stream, using: { data in return OpenGroupAPIV2.upload(data, to: v2OpenGroup.room, on: v2OpenGroup.server) }, encrypt: false, onSuccess: { seal.fulfill(()) }, onFailure: { seal.reject($0) }) + return promise + } else { + let (promise, seal) = Promise.pending() + AttachmentUploadJob.upload(stream, using: FileServerAPIV2.upload, encrypt: true, onSuccess: { seal.fulfill(()) }, onFailure: { seal.reject($0) }) + return promise + } + } + let (promise, seal) = Promise.pending() + let results = when(resolved: attachmentUploadPromises).wait() + let errors = results.compactMap { result -> Swift.Error? in + if case .rejected(let error) = result { return error } else { return nil } + } + if let error = errors.first { seal.reject(error) } + Storage.write{ transaction in + sendNonDurably(message, in: thread, using: transaction).done { + seal.fulfill(()) + }.catch { error in + seal.reject(error) + } + } + return promise + } } From 49688c0a2d27775472deb3e950c703c3e6dc2df8 Mon Sep 17 00:00:00 2001 From: ryanzhao Date: Fri, 1 Oct 2021 15:06:33 +1000 Subject: [PATCH 12/17] potentially fix a crash when setting nickname from null --- .../Messages/Control Messages/ConfigurationMessage.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SessionMessagingKit/Messages/Control Messages/ConfigurationMessage.swift b/SessionMessagingKit/Messages/Control Messages/ConfigurationMessage.swift index e27b50f92..20dcc7ee6 100644 --- a/SessionMessagingKit/Messages/Control Messages/ConfigurationMessage.swift +++ b/SessionMessagingKit/Messages/Control Messages/ConfigurationMessage.swift @@ -243,6 +243,6 @@ extension ConfigurationMessage { } } - public override var description: String { displayName! } + public override var description: String { displayName ?? "" } } } From ceb88f3d00c9cdf2f9993be07674271b402382dc Mon Sep 17 00:00:00 2001 From: ryanzhao Date: Fri, 1 Oct 2021 16:29:02 +1000 Subject: [PATCH 13/17] prevent disappearing message affecting the order of conversations --- SessionMessagingKit/Database/TSDatabaseView.m | 11 ++--------- SessionMessagingKit/Threads/TSThread.h | 1 + SessionMessagingKit/Threads/TSThread.m | 3 +++ 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/SessionMessagingKit/Database/TSDatabaseView.m b/SessionMessagingKit/Database/TSDatabaseView.m index 9d1073fc3..42be55700 100644 --- a/SessionMessagingKit/Database/TSDatabaseView.m +++ b/SessionMessagingKit/Database/TSDatabaseView.m @@ -278,15 +278,8 @@ NSString *const TSLazyRestoreAttachmentsGroup = @"TSLazyRestoreAttachmentsGroup" TSThread *thread1 = (TSThread *)object1; TSThread *thread2 = (TSThread *)object2; if ([group isEqualToString:TSArchiveGroup] || [group isEqualToString:TSInboxGroup]) { - - TSInteraction *_Nullable lastInteractionForInbox1 = - [thread1 lastInteractionForInboxWithTransaction:transaction]; - NSDate *date1 = lastInteractionForInbox1 ? lastInteractionForInbox1.receivedAtDate : thread1.creationDate; - - TSInteraction *_Nullable lastInteractionForInbox2 = - [thread2 lastInteractionForInboxWithTransaction:transaction]; - NSDate *date2 = lastInteractionForInbox2 ? lastInteractionForInbox2.receivedAtDate : thread2.creationDate; - + NSDate *date1 = thread1.lastInteractionDate ?: thread1.creationDate; + NSDate *date2 = thread2.lastInteractionDate ?: thread2.creationDate; return [date1 compare:date2]; } diff --git a/SessionMessagingKit/Threads/TSThread.h b/SessionMessagingKit/Threads/TSThread.h index 7ed517919..aa333d245 100644 --- a/SessionMessagingKit/Threads/TSThread.h +++ b/SessionMessagingKit/Threads/TSThread.h @@ -18,6 +18,7 @@ BOOL IsNoteToSelfEnabled(void); @property (nonatomic) BOOL shouldBeVisible; @property (nonatomic, readonly) NSDate *creationDate; +@property (nonatomic, readonly, nullable) NSDate *lastInteractionDate; @property (nonatomic, readonly) TSInteraction *lastInteraction; @property (atomic, readonly) BOOL isMuted; @property (atomic, readonly, nullable) NSDate *mutedUntilDate; diff --git a/SessionMessagingKit/Threads/TSThread.m b/SessionMessagingKit/Threads/TSThread.m index dbfa1ecd4..8d4b81770 100644 --- a/SessionMessagingKit/Threads/TSThread.m +++ b/SessionMessagingKit/Threads/TSThread.m @@ -21,6 +21,7 @@ BOOL IsNoteToSelfEnabled(void) @interface TSThread () @property (nonatomic) NSDate *creationDate; +@property (nonatomic, nullable) NSDate *lastInteractionDate; @property (nonatomic, nullable) NSNumber *archivedAsOfMessageSortId; @property (nonatomic, copy, nullable) NSString *messageDraft; @property (atomic, nullable) NSDate *mutedUntilDate; @@ -355,6 +356,8 @@ BOOL IsNoteToSelfEnabled(void) if (![self.class shouldInteractionAppearInInbox:lastMessage]) { return; } + + _lastInteractionDate = lastMessage.receivedAtDate; if (!self.shouldBeVisible) { self.shouldBeVisible = YES; From 204fe789ede0cd655504a5e52be72eac9c15c526 Mon Sep 17 00:00:00 2001 From: ryanzhao Date: Mon, 4 Oct 2021 11:56:05 +1100 Subject: [PATCH 14/17] fix sync message in open group won't be marked as sent --- SessionMessagingKit/Database/Storage+Messaging.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/SessionMessagingKit/Database/Storage+Messaging.swift b/SessionMessagingKit/Database/Storage+Messaging.swift index 0a6a84f99..e02363de7 100644 --- a/SessionMessagingKit/Database/Storage+Messaging.swift +++ b/SessionMessagingKit/Database/Storage+Messaging.swift @@ -32,8 +32,9 @@ extension Storage { var recipients: [String] = [] if let syncTarget = message.syncTarget { recipients.append(syncTarget) - } else if let thread = thread as? TSGroupThread, thread.isClosedGroup { - recipients = thread.groupModel.groupMemberIds + } else if let thread = thread as? TSGroupThread { + if thread.isClosedGroup { recipients = thread.groupModel.groupMemberIds } + else { recipients.append(LKGroupUtilities.getDecodedGroupID(thread.groupModel.groupId)) } } recipients.forEach { recipient in tsOutgoingMessage.update(withSentRecipient: recipient, wasSentByUD: true, transaction: transaction) From 0b5d6ae4b0f8c26e32e85e624e373a449cd6cc67 Mon Sep 17 00:00:00 2001 From: ryanzhao Date: Mon, 4 Oct 2021 14:39:28 +1100 Subject: [PATCH 15/17] fix disappearing messages for sync messages --- Session/Conversations/ConversationVC.swift | 1 + .../Expiration/OWSDisappearingMessagesJob.h | 1 + .../Expiration/OWSDisappearingMessagesJob.m | 11 +++++++++++ .../MessageReceiver+Handling.swift | 2 -- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Session/Conversations/ConversationVC.swift b/Session/Conversations/ConversationVC.swift index 5acfbb65b..fe75af3e7 100644 --- a/Session/Conversations/ConversationVC.swift +++ b/Session/Conversations/ConversationVC.swift @@ -443,6 +443,7 @@ final class ConversationVC : BaseVC, ConversationViewModelDelegate, OWSConversat func markAllAsRead() { guard let lastSortID = viewItems.last?.interaction.sortId else { return } OWSReadReceiptManager.shared().markAsReadLocally(beforeSortId: lastSortID, thread: thread) + SSKEnvironment.shared.disappearingMessagesJob.cleanupMessagesWhichFailedToStartExpiringFromNow() } func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat { diff --git a/SessionMessagingKit/Sending & Receiving/Expiration/OWSDisappearingMessagesJob.h b/SessionMessagingKit/Sending & Receiving/Expiration/OWSDisappearingMessagesJob.h index 26ad356f6..fa43294a4 100644 --- a/SessionMessagingKit/Sending & Receiving/Expiration/OWSDisappearingMessagesJob.h +++ b/SessionMessagingKit/Sending & Receiving/Expiration/OWSDisappearingMessagesJob.h @@ -49,6 +49,7 @@ NS_ASSUME_NONNULL_BEGIN // and continue cleaning in the background. - (void)startIfNecessary; +- (void)cleanupMessagesWhichFailedToStartExpiringFromNow; - (void)cleanupMessagesWhichFailedToStartExpiringWithTransaction:(YapDatabaseReadWriteTransaction *)transaction; @end diff --git a/SessionMessagingKit/Sending & Receiving/Expiration/OWSDisappearingMessagesJob.m b/SessionMessagingKit/Sending & Receiving/Expiration/OWSDisappearingMessagesJob.m index 8e6dfbcfb..31e797171 100644 --- a/SessionMessagingKit/Sending & Receiving/Expiration/OWSDisappearingMessagesJob.m +++ b/SessionMessagingKit/Sending & Receiving/Expiration/OWSDisappearingMessagesJob.m @@ -329,6 +329,17 @@ void AssertIsOnDisappearingMessagesQueue() #pragma mark - Cleanup +- (void)cleanupMessagesWhichFailedToStartExpiringFromNow +{ + [LKStorage writeWithBlock:^(YapDatabaseReadWriteTransaction *_Nonnull transaction) { + [self.disappearingMessagesFinder + enumerateMessagesWhichFailedToStartExpiringWithBlock:^(TSMessage *_Nonnull message) { + [self startAnyExpirationForMessage:message expirationStartedAt:[NSDate millisecondTimestamp] transaction:transaction]; + } + transaction:transaction]; + }]; +} + - (void)cleanupMessagesWhichFailedToStartExpiringWithTransaction:(YapDatabaseReadWriteTransaction *)transaction { [self.disappearingMessagesFinder diff --git a/SessionMessagingKit/Sending & Receiving/MessageReceiver+Handling.swift b/SessionMessagingKit/Sending & Receiving/MessageReceiver+Handling.swift index dbbeb6818..74103fc2f 100644 --- a/SessionMessagingKit/Sending & Receiving/MessageReceiver+Handling.swift +++ b/SessionMessagingKit/Sending & Receiving/MessageReceiver+Handling.swift @@ -332,8 +332,6 @@ extension MessageReceiver { let thread = TSThread.fetch(uniqueId: threadID, transaction: transaction) { // Mark previous messages as read if there is a sync message OWSReadReceiptManager.shared().markAsReadLocally(beforeSortId: tsOutgoingMessage.sortId, thread: thread) - // Start expiration for sync messages - OWSDisappearingMessagesJob.shared().startAnyExpiration(for: tsOutgoingMessage, expirationStartedAt: NSDate.millisecondTimestamp(), transaction: transaction) } // Notify the user if needed guard (isMainAppAndActive || isBackgroundPoll), let tsIncomingMessage = TSMessage.fetch(uniqueId: tsMessageID, transaction: transaction) as? TSIncomingMessage, From ad4e65e6e141e0e027e2698589fba49ef1718cb5 Mon Sep 17 00:00:00 2001 From: ryanzhao Date: Mon, 4 Oct 2021 14:57:07 +1100 Subject: [PATCH 16/17] improve attachment image quality --- .../Media Viewing & Editing/GIFs/GifPickerViewController.swift | 2 +- Session/Media Viewing & Editing/PhotoCapture.swift | 2 +- Session/Media Viewing & Editing/PhotoLibrary.swift | 2 +- .../Sending & Receiving/Attachments/SignalAttachment.swift | 3 +++ SessionShareExtension/ShareVC.swift | 2 +- .../Attachment Approval/AttachmentApprovalViewController.swift | 2 +- 6 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Session/Media Viewing & Editing/GIFs/GifPickerViewController.swift b/Session/Media Viewing & Editing/GIFs/GifPickerViewController.swift index 350ecf378..7726568ed 100644 --- a/Session/Media Viewing & Editing/GIFs/GifPickerViewController.swift +++ b/Session/Media Viewing & Editing/GIFs/GifPickerViewController.swift @@ -388,7 +388,7 @@ class GifPickerViewController: OWSViewController, UISearchBarDelegate, UICollect owsFailDebug("couldn't load asset.") return } - let attachment = SignalAttachment.attachment(dataSource: dataSource, dataUTI: rendition.utiType, imageQuality: .medium) + let attachment = SignalAttachment.attachment(dataSource: dataSource, dataUTI: rendition.utiType, imageQuality: .high) strongSelf.dismiss(animated: true) { // Delegate presents view controllers, so it's important that *this* controller be dismissed before that occurs. diff --git a/Session/Media Viewing & Editing/PhotoCapture.swift b/Session/Media Viewing & Editing/PhotoCapture.swift index 6c0eda63b..6e7693b1c 100644 --- a/Session/Media Viewing & Editing/PhotoCapture.swift +++ b/Session/Media Viewing & Editing/PhotoCapture.swift @@ -396,7 +396,7 @@ extension PhotoCapture: CaptureOutputDelegate { let dataSource = DataSourceValue.dataSource(with: photoData, utiType: kUTTypeJPEG as String) - let attachment = SignalAttachment.attachment(dataSource: dataSource, dataUTI: kUTTypeJPEG as String, imageQuality: .medium) + let attachment = SignalAttachment.attachment(dataSource: dataSource, dataUTI: kUTTypeJPEG as String, imageQuality: .high) delegate?.photoCapture(self, didFinishProcessingAttachment: attachment) } diff --git a/Session/Media Viewing & Editing/PhotoLibrary.swift b/Session/Media Viewing & Editing/PhotoLibrary.swift index 164c8b542..79d81986a 100644 --- a/Session/Media Viewing & Editing/PhotoLibrary.swift +++ b/Session/Media Viewing & Editing/PhotoLibrary.swift @@ -207,7 +207,7 @@ class PhotoCollectionContents { switch asset.mediaType { case .image: return requestImageDataSource(for: asset).map { (dataSource: DataSource, dataUTI: String) in - return SignalAttachment.attachment(dataSource: dataSource, dataUTI: dataUTI, imageQuality: .medium) + return SignalAttachment.attachment(dataSource: dataSource, dataUTI: dataUTI, imageQuality: .high) } case .video: return requestVideoDataSource(for: asset).map { (dataSource: DataSource, dataUTI: String) in diff --git a/SessionMessagingKit/Sending & Receiving/Attachments/SignalAttachment.swift b/SessionMessagingKit/Sending & Receiving/Attachments/SignalAttachment.swift index 6ef9d9598..b0061f696 100644 --- a/SessionMessagingKit/Sending & Receiving/Attachments/SignalAttachment.swift +++ b/SessionMessagingKit/Sending & Receiving/Attachments/SignalAttachment.swift @@ -75,6 +75,7 @@ public enum TSImageQualityTier: UInt { @objc public enum TSImageQuality: UInt { case original + case high case medium case compact @@ -82,6 +83,8 @@ public enum TSImageQuality: UInt { switch self { case .original: return .original + case .high: + return .high case .medium: return .mediumHigh case .compact: diff --git a/SessionShareExtension/ShareVC.swift b/SessionShareExtension/ShareVC.swift index 41cfa31a7..78e2974fb 100644 --- a/SessionShareExtension/ShareVC.swift +++ b/SessionShareExtension/ShareVC.swift @@ -552,7 +552,7 @@ final class ShareVC : UINavigationController, ShareViewDelegate, AppModeManagerD return promise } - let attachment = SignalAttachment.attachment(dataSource: dataSource, dataUTI: specificUTIType, imageQuality: .medium) + let attachment = SignalAttachment.attachment(dataSource: dataSource, dataUTI: specificUTIType, imageQuality: .high) if loadedItem.isConvertibleToContactShare { Logger.info("isConvertibleToContactShare") attachment.isConvertibleToContactShare = true diff --git a/SignalUtilitiesKit/Media Viewing & Editing/Attachment Approval/AttachmentApprovalViewController.swift b/SignalUtilitiesKit/Media Viewing & Editing/Attachment Approval/AttachmentApprovalViewController.swift index 66d0dc51e..a72a98326 100644 --- a/SignalUtilitiesKit/Media Viewing & Editing/Attachment Approval/AttachmentApprovalViewController.swift +++ b/SignalUtilitiesKit/Media Viewing & Editing/Attachment Approval/AttachmentApprovalViewController.swift @@ -623,7 +623,7 @@ public class AttachmentApprovalViewController: UIPageViewController, UIPageViewC } dataSource.sourceFilename = filename - let dstAttachment = SignalAttachment.attachment(dataSource: dataSource, dataUTI: dataUTI, imageQuality: .medium) + let dstAttachment = SignalAttachment.attachment(dataSource: dataSource, dataUTI: dataUTI, imageQuality: .high) if let attachmentError = dstAttachment.error { owsFailDebug("Could not prepare attachment for output: \(attachmentError).") return attachmentItem.attachment From b315510ec28b2c03ee786284d57be17d8b125eba Mon Sep 17 00:00:00 2001 From: ryanzhao Date: Mon, 4 Oct 2021 15:37:42 +1100 Subject: [PATCH 17/17] Revert "improve attachment image quality" This reverts commit ad4e65e6e141e0e027e2698589fba49ef1718cb5. --- .../Media Viewing & Editing/GIFs/GifPickerViewController.swift | 2 +- Session/Media Viewing & Editing/PhotoCapture.swift | 2 +- Session/Media Viewing & Editing/PhotoLibrary.swift | 2 +- .../Sending & Receiving/Attachments/SignalAttachment.swift | 3 --- SessionShareExtension/ShareVC.swift | 2 +- .../Attachment Approval/AttachmentApprovalViewController.swift | 2 +- 6 files changed, 5 insertions(+), 8 deletions(-) diff --git a/Session/Media Viewing & Editing/GIFs/GifPickerViewController.swift b/Session/Media Viewing & Editing/GIFs/GifPickerViewController.swift index 7726568ed..350ecf378 100644 --- a/Session/Media Viewing & Editing/GIFs/GifPickerViewController.swift +++ b/Session/Media Viewing & Editing/GIFs/GifPickerViewController.swift @@ -388,7 +388,7 @@ class GifPickerViewController: OWSViewController, UISearchBarDelegate, UICollect owsFailDebug("couldn't load asset.") return } - let attachment = SignalAttachment.attachment(dataSource: dataSource, dataUTI: rendition.utiType, imageQuality: .high) + let attachment = SignalAttachment.attachment(dataSource: dataSource, dataUTI: rendition.utiType, imageQuality: .medium) strongSelf.dismiss(animated: true) { // Delegate presents view controllers, so it's important that *this* controller be dismissed before that occurs. diff --git a/Session/Media Viewing & Editing/PhotoCapture.swift b/Session/Media Viewing & Editing/PhotoCapture.swift index 6e7693b1c..6c0eda63b 100644 --- a/Session/Media Viewing & Editing/PhotoCapture.swift +++ b/Session/Media Viewing & Editing/PhotoCapture.swift @@ -396,7 +396,7 @@ extension PhotoCapture: CaptureOutputDelegate { let dataSource = DataSourceValue.dataSource(with: photoData, utiType: kUTTypeJPEG as String) - let attachment = SignalAttachment.attachment(dataSource: dataSource, dataUTI: kUTTypeJPEG as String, imageQuality: .high) + let attachment = SignalAttachment.attachment(dataSource: dataSource, dataUTI: kUTTypeJPEG as String, imageQuality: .medium) delegate?.photoCapture(self, didFinishProcessingAttachment: attachment) } diff --git a/Session/Media Viewing & Editing/PhotoLibrary.swift b/Session/Media Viewing & Editing/PhotoLibrary.swift index 79d81986a..164c8b542 100644 --- a/Session/Media Viewing & Editing/PhotoLibrary.swift +++ b/Session/Media Viewing & Editing/PhotoLibrary.swift @@ -207,7 +207,7 @@ class PhotoCollectionContents { switch asset.mediaType { case .image: return requestImageDataSource(for: asset).map { (dataSource: DataSource, dataUTI: String) in - return SignalAttachment.attachment(dataSource: dataSource, dataUTI: dataUTI, imageQuality: .high) + return SignalAttachment.attachment(dataSource: dataSource, dataUTI: dataUTI, imageQuality: .medium) } case .video: return requestVideoDataSource(for: asset).map { (dataSource: DataSource, dataUTI: String) in diff --git a/SessionMessagingKit/Sending & Receiving/Attachments/SignalAttachment.swift b/SessionMessagingKit/Sending & Receiving/Attachments/SignalAttachment.swift index b0061f696..6ef9d9598 100644 --- a/SessionMessagingKit/Sending & Receiving/Attachments/SignalAttachment.swift +++ b/SessionMessagingKit/Sending & Receiving/Attachments/SignalAttachment.swift @@ -75,7 +75,6 @@ public enum TSImageQualityTier: UInt { @objc public enum TSImageQuality: UInt { case original - case high case medium case compact @@ -83,8 +82,6 @@ public enum TSImageQuality: UInt { switch self { case .original: return .original - case .high: - return .high case .medium: return .mediumHigh case .compact: diff --git a/SessionShareExtension/ShareVC.swift b/SessionShareExtension/ShareVC.swift index 78e2974fb..41cfa31a7 100644 --- a/SessionShareExtension/ShareVC.swift +++ b/SessionShareExtension/ShareVC.swift @@ -552,7 +552,7 @@ final class ShareVC : UINavigationController, ShareViewDelegate, AppModeManagerD return promise } - let attachment = SignalAttachment.attachment(dataSource: dataSource, dataUTI: specificUTIType, imageQuality: .high) + let attachment = SignalAttachment.attachment(dataSource: dataSource, dataUTI: specificUTIType, imageQuality: .medium) if loadedItem.isConvertibleToContactShare { Logger.info("isConvertibleToContactShare") attachment.isConvertibleToContactShare = true diff --git a/SignalUtilitiesKit/Media Viewing & Editing/Attachment Approval/AttachmentApprovalViewController.swift b/SignalUtilitiesKit/Media Viewing & Editing/Attachment Approval/AttachmentApprovalViewController.swift index a72a98326..66d0dc51e 100644 --- a/SignalUtilitiesKit/Media Viewing & Editing/Attachment Approval/AttachmentApprovalViewController.swift +++ b/SignalUtilitiesKit/Media Viewing & Editing/Attachment Approval/AttachmentApprovalViewController.swift @@ -623,7 +623,7 @@ public class AttachmentApprovalViewController: UIPageViewController, UIPageViewC } dataSource.sourceFilename = filename - let dstAttachment = SignalAttachment.attachment(dataSource: dataSource, dataUTI: dataUTI, imageQuality: .high) + let dstAttachment = SignalAttachment.attachment(dataSource: dataSource, dataUTI: dataUTI, imageQuality: .medium) if let attachmentError = dstAttachment.error { owsFailDebug("Could not prepare attachment for output: \(attachmentError).") return attachmentItem.attachment