From b8a25a7942a7306722e3953412b2dd73e5109dae Mon Sep 17 00:00:00 2001 From: nielsandriesse Date: Fri, 30 Oct 2020 11:07:37 +1100 Subject: [PATCH 1/3] Fix incorrect flag --- .../Loki/Redesign/Components/ProfilePictureView.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SignalMessaging/Loki/Redesign/Components/ProfilePictureView.swift b/SignalMessaging/Loki/Redesign/Components/ProfilePictureView.swift index 2f74b9891..cf2aa5c78 100644 --- a/SignalMessaging/Loki/Redesign/Components/ProfilePictureView.swift +++ b/SignalMessaging/Loki/Redesign/Components/ProfilePictureView.swift @@ -5,7 +5,7 @@ public final class ProfilePictureView : UIView { private var imageViewHeightConstraint: NSLayoutConstraint! private var additionalImageViewWidthConstraint: NSLayoutConstraint! private var additionalImageViewHeightConstraint: NSLayoutConstraint! - private var isUsingPlaceholder: Bool = true + private var hasTappableProfilePicture: Bool = false @objc public var size: CGFloat = 0 // Not an implicitly unwrapped optional due to Obj-C limitations @objc public var isRSSFeed = false @objc public var hexEncodedPublicKey: String! @@ -66,7 +66,7 @@ public final class ProfilePictureView : UIView { } else if let openGroupProfilePicture = thread.groupModel.groupImage { // An open group with a profile picture self.openGroupProfilePicture = openGroupProfilePicture isRSSFeed = false - isUsingPlaceholder = false + hasTappableProfilePicture = true } else if thread.groupModel.groupType == .openGroup || thread.groupModel.groupType == .rssFeed { // An open group without a profile picture or an RSS feed hexEncodedPublicKey = "" @@ -84,6 +84,7 @@ public final class ProfilePictureView : UIView { } update() } else { // A one-to-one chat + hasTappableProfilePicture = OWSProfileManager.shared().profileAvatar(forRecipientId: thread.contactIdentifier()!) != nil update(for: thread.contactIdentifier()!) } } @@ -93,7 +94,6 @@ public final class ProfilePictureView : UIView { func getProfilePicture(of size: CGFloat, for publicKey: String) -> UIImage? { guard !publicKey.isEmpty else { return nil } if let profilePicture = OWSProfileManager.shared().profileAvatar(forRecipientId: publicKey) { - isUsingPlaceholder = false return profilePicture } else { let displayName = OWSProfileManager.shared().profileNameForRecipient(withID: publicKey) ?? publicKey @@ -149,6 +149,6 @@ public final class ProfilePictureView : UIView { } @objc public func getProfilePicture() -> UIImage? { - return isUsingPlaceholder ? nil : imageView.image + return hasTappableProfilePicture ? imageView.image : nil } } From 19a0c325ddf3027adb955f9e7c91487464e220dc Mon Sep 17 00:00:00 2001 From: nielsandriesse Date: Fri, 30 Oct 2020 11:40:05 +1100 Subject: [PATCH 2/3] Fix various share screen issues --- .../ViewControllers/SelectThreadViewController.m | 3 +++ SignalMessaging/Views/ContactCellView.m | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/SignalMessaging/ViewControllers/SelectThreadViewController.m b/SignalMessaging/ViewControllers/SelectThreadViewController.m index f4d3b0bfe..8c69e94a1 100644 --- a/SignalMessaging/ViewControllers/SelectThreadViewController.m +++ b/SignalMessaging/ViewControllers/SelectThreadViewController.m @@ -129,6 +129,9 @@ NS_ASSUME_NONNULL_BEGIN [_tableViewController.view autoPinEdgeToSuperviewEdge:ALEdgeBottom]; self.tableViewController.tableView.rowHeight = UITableViewAutomaticDimension; self.tableViewController.tableView.estimatedRowHeight = 60; + BOOL isIphone6OrSmaller = (UIScreen.mainScreen.bounds.size.height - 667) < 1; + CGFloat bottomInset = isIphone6OrSmaller ? LKValues.mediumSpacing : 34.0f; + self.tableViewController.tableView.contentInset = UIEdgeInsetsMake(0, 0, bottomInset, 0); } - (void)yapDatabaseModifiedExternally:(NSNotification *)notification diff --git a/SignalMessaging/Views/ContactCellView.m b/SignalMessaging/Views/ContactCellView.m index 179d7a079..be6053e5c 100644 --- a/SignalMessaging/Views/ContactCellView.m +++ b/SignalMessaging/Views/ContactCellView.m @@ -196,6 +196,9 @@ const CGFloat kContactCellAvatarTextMargin = 12; name:kNSNotificationName_OtherUsersProfileDidChange object:nil]; [self updateProfileName]; + } else { + self.nameLabel.text = thread.name; + [self.nameLabel setNeedsLayout]; } [self updateAvatar]; @@ -211,6 +214,9 @@ const CGFloat kContactCellAvatarTextMargin = 12; - (void)updateAvatar { + [LKStorage readWithBlock:^(YapDatabaseReadTransaction *transaction) { + [LKMentionsManager populateUserPublicKeyCacheIfNeededFor:self.thread.uniqueId in:transaction]; // FIXME: This is a terrible place to do this + }]; if (self.thread != nil) { [self.profilePictureView updateForThread:self.thread]; } else { From 7fc1eb2e91f0ba4d2b6ef512ac9aeb5e9bf8c67a Mon Sep 17 00:00:00 2001 From: nielsandriesse Date: Fri, 30 Oct 2020 11:40:56 +1100 Subject: [PATCH 3/3] Update version number --- Signal.xcodeproj/project.pbxproj | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/Signal.xcodeproj/project.pbxproj b/Signal.xcodeproj/project.pbxproj index 3f9208359..a8660ffbe 100644 --- a/Signal.xcodeproj/project.pbxproj +++ b/Signal.xcodeproj/project.pbxproj @@ -4165,7 +4165,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 137; + CURRENT_PROJECT_VERSION = 138; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; @@ -4179,7 +4179,7 @@ INFOPLIST_FILE = SignalShareExtension/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; - MARKETING_VERSION = 1.6.3; + MARKETING_VERSION = 1.6.4; MTL_ENABLE_DEBUG_INFO = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.loki-project.loki-messenger.share-extension"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -4227,7 +4227,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 137; + CURRENT_PROJECT_VERSION = 138; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = SUQ8J2PCT7; ENABLE_NS_ASSERTIONS = NO; @@ -4246,7 +4246,7 @@ INFOPLIST_FILE = SignalShareExtension/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; - MARKETING_VERSION = 1.6.3; + MARKETING_VERSION = 1.6.4; MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_BUNDLE_IDENTIFIER = "com.loki-project.loki-messenger.share-extension"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -4281,7 +4281,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 137; + CURRENT_PROJECT_VERSION = 138; DEBUG_INFORMATION_FORMAT = dwarf; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = SUQ8J2PCT7; @@ -4300,7 +4300,7 @@ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MARKETING_VERSION = 1.6.3; + MARKETING_VERSION = 1.6.4; MTL_ENABLE_DEBUG_INFO = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.loki-project.loki-messenger.utilities"; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; @@ -4351,7 +4351,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 137; + CURRENT_PROJECT_VERSION = 138; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = SUQ8J2PCT7; @@ -4375,7 +4375,7 @@ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MARKETING_VERSION = 1.6.3; + MARKETING_VERSION = 1.6.4; MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_BUNDLE_IDENTIFIER = "com.loki-project.loki-messenger.utilities"; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; @@ -4413,7 +4413,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 137; + CURRENT_PROJECT_VERSION = 138; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; @@ -4425,7 +4425,7 @@ INFOPLIST_FILE = LokiPushNotificationService/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; - MARKETING_VERSION = 1.6.3; + MARKETING_VERSION = 1.6.4; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.loki-project.loki-messenger.push-notification-service"; @@ -4476,7 +4476,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 137; + CURRENT_PROJECT_VERSION = 138; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = SUQ8J2PCT7; ENABLE_NS_ASSERTIONS = NO; @@ -4493,7 +4493,7 @@ INFOPLIST_FILE = LokiPushNotificationService/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; - MARKETING_VERSION = 1.6.3; + MARKETING_VERSION = 1.6.4; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.loki-project.loki-messenger.push-notification-service"; @@ -4677,7 +4677,7 @@ CODE_SIGN_ENTITLEMENTS = Signal/Signal.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 137; + CURRENT_PROJECT_VERSION = 138; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -4712,7 +4712,7 @@ "$(SRCROOT)", ); LLVM_LTO = NO; - MARKETING_VERSION = 1.6.3; + MARKETING_VERSION = 1.6.4; OTHER_LDFLAGS = "$(inherited)"; OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\""; PRODUCT_BUNDLE_IDENTIFIER = "com.loki-project.loki-messenger"; @@ -4744,7 +4744,7 @@ CODE_SIGN_ENTITLEMENTS = Signal/Signal.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 137; + CURRENT_PROJECT_VERSION = 138; DEVELOPMENT_TEAM = SUQ8J2PCT7; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -4779,7 +4779,7 @@ "$(SRCROOT)", ); LLVM_LTO = NO; - MARKETING_VERSION = 1.6.3; + MARKETING_VERSION = 1.6.4; OTHER_LDFLAGS = "$(inherited)"; PRODUCT_BUNDLE_IDENTIFIER = "com.loki-project.loki-messenger"; PRODUCT_NAME = Session;