diff --git a/Signal/Signal-Info.plist b/Signal/Signal-Info.plist index a1683626a3..91c5020739 100644 --- a/Signal/Signal-Info.plist +++ b/Signal/Signal-Info.plist @@ -43,7 +43,7 @@ CFBundleVersion - 34 + 37 ITSAppUsesNonExemptEncryption LOGS_EMAIL @@ -141,7 +141,7 @@ INStartCallIntent OWSBundleVersion4 - 5.27.0.34 + 5.27.0.37 PHPhotoLibraryPreventAutomaticLimitedAccessAlert UIAppFonts diff --git a/Signal/src/ViewControllers/AppSettings/AppSettingsViewController.swift b/Signal/src/ViewControllers/AppSettings/AppSettingsViewController.swift index 93ac218dba..388bd71cfc 100644 --- a/Signal/src/ViewControllers/AppSettings/AppSettingsViewController.swift +++ b/Signal/src/ViewControllers/AppSettings/AppSettingsViewController.swift @@ -40,6 +40,13 @@ class AppSettingsViewController: OWSTableViewController2 { name: .localNumberDidChange, object: nil ) + + NotificationCenter.default.addObserver( + self, + selector: #selector(subscriptionStateDidChange), + name: SubscriptionManager.SubscriptionJobQueueDidFinishJobNotification, + object: nil + ) } @objc @@ -61,6 +68,13 @@ class AppSettingsViewController: OWSTableViewController2 { updateTableContents() } + @objc + func subscriptionStateDidChange() { + AssertIsOnMainThread() + + updateTableContents() + } + override func themeDidChange() { super.themeDidChange() updateTableContents() @@ -70,6 +84,10 @@ class AppSettingsViewController: OWSTableViewController2 { return SubscriptionManager.hasCurrentSubscriptionCached() }() + private lazy var hasExpiredSubscription: Bool = { + return SubscriptionManager.mostRecentlyExpiredBadgeIDWithSneakyTransaction() != nil + }() + func updateTableContents() { let contents = OWSTableContents() @@ -253,15 +271,29 @@ class AppSettingsViewController: OWSTableViewController2 { )) if RemoteConfig.donorBadgeAcquisition { if DonationUtilities.isApplePayAvailable { - section4.add(.disclosureItem( - icon: .settingsDonate, - name: self.hasCurrentSubscription ? NSLocalizedString("SETTINGS_CURRENT_SUBSCRIPTION", comment: "Title for the 'Subscription' link in settings.") : NSLocalizedString("SETTINGS_SUBSCRIPTION", comment: "Title for the 'become a sustainer' link in settings."), - accessibilityIdentifier: UIView.accessibilityIdentifier(in: self, name: "sustainer"), - actionBlock: { [weak self] in - let vc = SubscriptionViewController() - self?.navigationController?.pushViewController(vc, animated: true) + section4.add(.init(customCellBlock: { [weak self] in + guard let self = self else { return UITableViewCell() } + let cell = OWSTableItem.buildCellWithAccessoryLabel( + icon: .settingsDonate, + itemName: self.hasCurrentSubscription ? NSLocalizedString("SETTINGS_CURRENT_SUBSCRIPTION", comment: "Title for the 'Subscription' link in settings.") : NSLocalizedString("SETTINGS_SUBSCRIPTION", comment: "Title for the 'become a sustainer' link in settings."), + accessoryType: .disclosureIndicator, + accessibilityIdentifier: UIView.accessibilityIdentifier(in: self, name: "sustainer")) + + if self.hasExpiredSubscription { + let imageView = UIImageView(image: UIImage(named: "info-solid-24")?.withRenderingMode(.alwaysTemplate)) + imageView.tintColor = Theme.accentBlueColor + cell.contentView.addSubview(imageView) + + imageView.autoSetDimensions(to: CGSize(square: 24)) + imageView.autoVCenterInSuperview() + imageView.autoPinEdge(.trailing, to: .trailing, of: cell.contentView, withOffset: -8) } - )) + + return cell + }, actionBlock: { [weak self] in + let vc = SubscriptionViewController() + self?.navigationController?.pushViewController(vc, animated: true) + })) section4.add(.disclosureItem( icon: .settingsBoost, diff --git a/Signal/src/ViewControllers/AppSettings/SubscriptionViewController.swift b/Signal/src/ViewControllers/AppSettings/SubscriptionViewController.swift index e42b65318a..f911ec3857 100644 --- a/Signal/src/ViewControllers/AppSettings/SubscriptionViewController.swift +++ b/Signal/src/ViewControllers/AppSettings/SubscriptionViewController.swift @@ -274,7 +274,7 @@ class SubscriptionViewController: OWSTableViewController2 { } let expiredBadgeID = SubscriptionManager.mostRecentlyExpiredBadgeIDWithSneakyTransaction() - guard let expiredBadgeID = expiredBadgeID else { + guard let expiredBadgeID = expiredBadgeID, expiredBadgeID != "BOOST" else { return } @@ -1526,6 +1526,7 @@ private class SubscriptionReadMoreSheet: InteractiveSheetViewController { extension SubscriptionViewController: BadgeExpirationSheetDelegate { func badgeExpirationSheetActionButtonTapped(_ badgeExpirationSheet: BadgeExpirationSheet) { + SubscriptionManager.clearMostRecentlyExpiredBadgeIDWithSneakyTransaction() requestApplePayDonation() } diff --git a/Signal/src/ViewControllers/DebugUI/DebugUIScreenshots.swift b/Signal/src/ViewControllers/DebugUI/DebugUIScreenshots.swift index 38dabc0568..e595e49124 100644 --- a/Signal/src/ViewControllers/DebugUI/DebugUIScreenshots.swift +++ b/Signal/src/ViewControllers/DebugUI/DebugUIScreenshots.swift @@ -1013,7 +1013,7 @@ public extension DebugUIScreenshots { profileBio: nil, profileBioEmoji: nil, profileAvatarData: avatarData, - visibleBadgeIds: nil, + visibleBadgeIds: [], userProfileWriter: .debugging ).asVoid() }.catch(on: .global()) { error in diff --git a/Signal/src/ViewControllers/HomeView/HVTableDataSource.swift b/Signal/src/ViewControllers/HomeView/HVTableDataSource.swift index f0e6377636..f8c5f8798f 100644 --- a/Signal/src/ViewControllers/HomeView/HVTableDataSource.swift +++ b/Signal/src/ViewControllers/HomeView/HVTableDataSource.swift @@ -725,6 +725,21 @@ extension HVTableDataSource: UITableViewDataSource { extension HVTableDataSource { + public func updateVisibleCellContent(at indexPath: IndexPath, for tableView: UITableView) -> Bool { + AssertIsOnMainThread() + + if let primKey = threadViewModel(forIndexPath: indexPath)?.threadRecord.uniqueId, (tableView.indexPathsForVisibleRows ?? []).contains(indexPath) { + for cell in tableView.visibleCells { + if let homeCell = cell as? HomeViewCell, let myKey = homeCell.thread?.uniqueId, myKey == primKey, let token = buildCellConfigurationAndContentTokenSync(forIndexPath: indexPath)?.contentToken { + homeCell.reset() + homeCell.configure(cellContentToken: token) + return true + } + } + } + return false + } + fileprivate struct HVCellConfigurationAndContentToken { let configuration: HomeViewCell.Configuration let contentToken: HVCellContentToken diff --git a/Signal/src/ViewControllers/HomeView/HomeViewController+Loading.swift b/Signal/src/ViewControllers/HomeView/HomeViewController+Loading.swift index 1f65b7efdc..019f14c322 100644 --- a/Signal/src/ViewControllers/HomeView/HomeViewController+Loading.swift +++ b/Signal/src/ViewControllers/HomeView/HomeViewController+Loading.swift @@ -157,7 +157,10 @@ extension HomeViewController { tableView.insertRows(at: [newIndexPath], with: rowAnimation) } case .update(let oldIndexPath): - tableView.reloadRows(at: [oldIndexPath], with: .none) + let tds = tableView.dataSource as? HVTableDataSource + if tds == nil || !tds!.updateVisibleCellContent(at: oldIndexPath, for: tableView) { + tableView.reloadRows(at: [oldIndexPath], with: .none) + } } } diff --git a/Signal/src/ViewControllers/HomeView/HomeViewController.swift b/Signal/src/ViewControllers/HomeView/HomeViewController.swift index 46159977f8..3ddb7c130c 100644 --- a/Signal/src/ViewControllers/HomeView/HomeViewController.swift +++ b/Signal/src/ViewControllers/HomeView/HomeViewController.swift @@ -59,7 +59,7 @@ public extension HomeViewController { } let expiredBadgeID = SubscriptionManager.mostRecentlyExpiredBadgeIDWithSneakyTransaction() - guard let expiredBadgeID = expiredBadgeID, expiredBadgeID != "BOOST" else { // TODO Add boost support + guard let expiredBadgeID = expiredBadgeID else { return } @@ -71,35 +71,61 @@ public extension HomeViewController { return } - // Fetch current subscriptions, required to populate badge assets - firstly { - SubscriptionManager.getSubscriptions() - }.done(on: .global()) { (subscriptions: [SubscriptionLevel]) in - for level in subscriptions { - if level.badge.id == expiredBadgeID { - // Fetch assets - firstly { - self.profileManager.badgeStore.populateAssetsOnBadge(level.badge) - }.done(on: .main) { + if expiredBadgeID == "BOOST" { + firstly { + SubscriptionManager.getBoostBadge() + }.done(on: .global()) { boostBadge in + firstly { + self.profileManager.badgeStore.populateAssetsOnBadge(boostBadge) + }.done(on: .main) { - SDSDatabaseStorage.shared.write { transaction in - SubscriptionManager.setShowExpirySheetOnHomeScreenKey(show: false, transaction: transaction) - } - - let badgeSheet = BadgeExpirationSheet(badge: level.badge) - badgeSheet.delegate = self - self.present(badgeSheet, animated: true) - - }.catch { error in - owsFailDebug("Failed to fetch badge assets for expiry \(error)") + SDSDatabaseStorage.shared.write { transaction in + SubscriptionManager.setShowExpirySheetOnHomeScreenKey(show: false, transaction: transaction) } - break + let badgeSheet = BadgeExpirationSheet(badge: boostBadge) + badgeSheet.delegate = self + self.present(badgeSheet, animated: true) + + }.catch { error in + owsFailDebug("Failed to fetch boost badge assets for expiry \(error)") } + }.catch { error in + owsFailDebug("Failed to fetch boost badge for expiry \(error)") + } + + } else { + // Fetch current subscriptions, required to populate badge assets + firstly { + SubscriptionManager.getSubscriptions() + }.done(on: .global()) { (subscriptions: [SubscriptionLevel]) in + let subscriptionLevel = subscriptions.first { $0.badge.id == expiredBadgeID } + guard let subscriptionLevel = subscriptionLevel else { + owsFailDebug("Unable to find matching subscription level for expired badge") + return + } + + firstly { + self.profileManager.badgeStore.populateAssetsOnBadge(subscriptionLevel.badge) + }.done(on: .main) { + + SDSDatabaseStorage.shared.write { transaction in + SubscriptionManager.setShowExpirySheetOnHomeScreenKey(show: false, transaction: transaction) + } + + let badgeSheet = BadgeExpirationSheet(badge: subscriptionLevel.badge) + badgeSheet.delegate = self + self.present(badgeSheet, animated: true) + + }.catch { error in + owsFailDebug("Failed to fetch subscription badge assets for expiry \(error)") + } + + }.catch { error in + owsFailDebug("Failed to fetch subscriptions for expiry \(error)") } - }.catch { error in - owsFailDebug("Failed to fetch subscriptions for expiry \(error)") } + } // MARK: - @@ -369,8 +395,12 @@ public extension HomeViewController { extension HomeViewController: BadgeExpirationSheetDelegate { func badgeExpirationSheetActionButtonTapped(_ badgeExpirationSheet: BadgeExpirationSheet) { SubscriptionManager.clearMostRecentlyExpiredBadgeIDWithSneakyTransaction() - let mode: ShowAppSettingsMode = badgeExpirationSheet.badgeID == "BOOST" ? .boost : .subscriptions - showAppSettings(mode: mode) + switch (badgeID: badgeExpirationSheet.badgeID, isSustainer: SubscriptionManager.hasCurrentSubscriptionCached()) { + case (badgeID: "BOOST", isSustainer: true): + showAppSettings(mode: .boost) + default: + showAppSettings(mode: .subscriptions) + } } func badgeExpirationSheetNotNowButtonTapped(_ badgeExpirationSheet: BadgeExpirationSheet) { } diff --git a/Signal/src/ViewControllers/Registration/Onboarding/OnboardingProfileCreationViewController.swift b/Signal/src/ViewControllers/Registration/Onboarding/OnboardingProfileCreationViewController.swift index 945a37c91d..03f88ae8aa 100644 --- a/Signal/src/ViewControllers/Registration/Onboarding/OnboardingProfileCreationViewController.swift +++ b/Signal/src/ViewControllers/Registration/Onboarding/OnboardingProfileCreationViewController.swift @@ -343,7 +343,7 @@ public class OnboardingProfileCreationViewController: OnboardingBaseViewControll profileBio: nil, profileBioEmoji: nil, profileAvatarData: avatarData, - visibleBadgeIds: nil, + visibleBadgeIds: [], userProfileWriter: .registration) }.recover { error in owsFailDebug("Error: \(error)") diff --git a/SignalMessaging/contacts/ContactsManagerCache.swift b/SignalMessaging/contacts/ContactsManagerCache.swift index cab2112a87..325f260720 100644 --- a/SignalMessaging/contacts/ContactsManagerCache.swift +++ b/SignalMessaging/contacts/ContactsManagerCache.swift @@ -87,23 +87,24 @@ public class ContactsMaps: NSObject { } fileprivate static func phoneNumbers(forContact contact: Contact, localNumber: String?) -> [String] { - return contact.parsedPhoneNumbers.compactMap { phoneNumber in + let phoneNumbers: [String] = contact.parsedPhoneNumbers.compactMap { phoneNumber in guard let phoneNumberE164 = phoneNumber.toE164().nilIfEmpty else { return nil } - // Ignore any system contact records for the local contact. - // For the local user we never want to show the avatar / - // name that you have entered for yourself in your system - // contacts. Instead, we always want to display your profile - // name and avatar. - let isLocalContact = phoneNumberE164 == localNumber - guard !isLocalContact else { - return nil - } - return phoneNumberE164 } + + if let localNumber = localNumber, phoneNumbers.contains(localNumber) { + // Ignore any system contact records for the local contact. + // For the local user we never want to show the avatar / + // name that you have entered for yourself in your system + // contacts. Instead, we always want to display your profile + // name and avatar. + return [] + } + + return phoneNumbers } @objc diff --git a/SignalMessaging/contacts/OWSContactsManager.swift b/SignalMessaging/contacts/OWSContactsManager.swift index 947a0d3abb..da3c59dc84 100644 --- a/SignalMessaging/contacts/OWSContactsManager.swift +++ b/SignalMessaging/contacts/OWSContactsManager.swift @@ -566,6 +566,11 @@ extension OWSContactsManager { return nil } + guard !address.isLocalAddress else { + // Never use system contact or synced image data for the local user + return nil + } + if let phoneNumber = self.phoneNumber(for: address, transaction: transaction), let contact = contactsManagerCache.contact(forPhoneNumber: phoneNumber, transaction: transaction), let cnContactId = contact.cnContactId, diff --git a/SignalMessaging/profiles/OWSProfileManager.swift b/SignalMessaging/profiles/OWSProfileManager.swift index 31b058e31c..775f20a013 100644 --- a/SignalMessaging/profiles/OWSProfileManager.swift +++ b/SignalMessaging/profiles/OWSProfileManager.swift @@ -20,7 +20,7 @@ public extension OWSProfileManager { profileBio: String?, profileBioEmoji: String?, profileAvatarData: Data?, - visibleBadgeIds: [String]?, + visibleBadgeIds: [String], unsavedRotatedProfileKey: OWSAES256Key? = nil, userProfileWriter: UserProfileWriter) -> Promise { assert(CurrentAppContext().isMainApp) @@ -60,7 +60,7 @@ public extension OWSProfileManager { let profileBio: String? let profileBioEmoji: String? let profileAvatarData: Data? - let visibleBadgeIds: [String]? + let visibleBadgeIds: [String] let userProfileWriter: UserProfileWriter if let pendingUpdate = (Self.databaseStorage.read { transaction in return Self.currentPendingProfileUpdate(transaction: transaction) @@ -227,7 +227,7 @@ public extension OWSProfileManager { profileBio: String?, profileBioEmoji: String?, profileAvatarData: Data?, - visibleBadgeIds: [String]?, + visibleBadgeIds: [String], userProfileWriter: UserProfileWriter) -> AnyPromise { return AnyPromise(updateLocalProfilePromise( profileGivenName: profileGivenName, @@ -453,7 +453,7 @@ extension OWSProfileManager { "profileFamilyName?: \(attempt.update.profileFamilyName != nil), " + "profileBio?: \(attempt.update.profileBio != nil), " + "profileBioEmoji?: \(attempt.update.profileBioEmoji != nil) " + - "visibleBadges?: \(attempt.update.visibleBadgeIds != nil).") + "visibleBadges?: \(attempt.update.visibleBadgeIds.count).") return firstly(on: .global()) { Self.versionedProfilesImpl.updateProfilePromise(profileGivenName: attempt.update.profileGivenName, profileFamilyName: attempt.update.profileFamilyName, @@ -490,7 +490,7 @@ extension OWSProfileManager { profileBio: String?, profileBioEmoji: String?, profileAvatarData: Data?, - visibleBadgeIds: [String]?, + visibleBadgeIds: [String], unsavedRotatedProfileKey: OWSAES256Key?, userProfileWriter: UserProfileWriter) -> PendingProfileUpdate { Logger.verbose("") @@ -560,7 +560,7 @@ class PendingProfileUpdate: NSObject, NSCoding { // If nil, we are clearing the profile avatar. let profileAvatarData: Data? - let visibleBadgeIds: [String]? + let visibleBadgeIds: [String] let unsavedRotatedProfileKey: OWSAES256Key? @@ -585,7 +585,7 @@ class PendingProfileUpdate: NSObject, NSCoding { profileBio: String?, profileBioEmoji: String?, profileAvatarData: Data?, - visibleBadgeIds: [String]?, + visibleBadgeIds: [String], unsavedRotatedProfileKey: OWSAES256Key?, userProfileWriter: UserProfileWriter) { @@ -632,7 +632,7 @@ class PendingProfileUpdate: NSObject, NSCoding { self.profileBio = aDecoder.decodeObject(forKey: "profileBio") as? String self.profileBioEmoji = aDecoder.decodeObject(forKey: "profileBioEmoji") as? String self.profileAvatarData = aDecoder.decodeObject(forKey: "profileAvatarData") as? Data - self.visibleBadgeIds = aDecoder.decodeObject(forKey: "visiboleBadgeIds") as? [String] + self.visibleBadgeIds = (aDecoder.decodeObject(forKey: "visibleBadgeIds") as? [String]) ?? [] self.unsavedRotatedProfileKey = aDecoder.decodeObject(forKey: "unsavedRotatedProfileKey") as? OWSAES256Key if aDecoder.containsValue(forKey: "userProfileWriter"), let userProfileWriter = UserProfileWriter(rawValue: UInt(aDecoder.decodeInt32(forKey: "userProfileWriter"))) { diff --git a/SignalMessaging/profiles/VersionedProfilesImpl.swift b/SignalMessaging/profiles/VersionedProfilesImpl.swift index 4d38a2d2df..70b56ac789 100644 --- a/SignalMessaging/profiles/VersionedProfilesImpl.swift +++ b/SignalMessaging/profiles/VersionedProfilesImpl.swift @@ -41,7 +41,7 @@ public class VersionedProfilesImpl: NSObject, VersionedProfilesSwift { profileBio: String?, profileBioEmoji: String?, profileAvatarData: Data?, - visibleBadgeIds: [String]?, + visibleBadgeIds: [String], unsavedRotatedProfileKey: OWSAES256Key?) -> Promise { firstly(on: .global()) { diff --git a/SignalNSE/Info.plist b/SignalNSE/Info.plist index fb32550175..5d6649b011 100644 --- a/SignalNSE/Info.plist +++ b/SignalNSE/Info.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString 5.27.0 CFBundleVersion - 34 + 37 NSAppTransportSecurity NSExceptionDomains @@ -55,7 +55,7 @@ $(PRODUCT_MODULE_NAME).NotificationService OWSBundleVersion4 - 5.27.0.34 + 5.27.0.37 UIAppFonts Inter-Medium.otf diff --git a/SignalServiceKit/src/Network/API/Requests/OWSRequestFactory.h b/SignalServiceKit/src/Network/API/Requests/OWSRequestFactory.h index ed55420490..d220641725 100644 --- a/SignalServiceKit/src/Network/API/Requests/OWSRequestFactory.h +++ b/SignalServiceKit/src/Network/API/Requests/OWSRequestFactory.h @@ -179,7 +179,7 @@ typedef NS_ENUM(NSUInteger, TSVerificationTransport) { TSVerificationTransportVo bioEmoji:(nullable ProfileValue *)bioEmoji hasAvatar:(BOOL)hasAvatar paymentAddress:(nullable ProfileValue *)paymentAddress - visibleBadgeIds:(nullable NSArray *)visibleBadgeIds + visibleBadgeIds:(NSArray *)visibleBadgeIds version:(NSString *)version commitment:(NSData *)commitment; diff --git a/SignalServiceKit/src/Network/API/Requests/OWSRequestFactory.m b/SignalServiceKit/src/Network/API/Requests/OWSRequestFactory.m index 104ee1ac68..b288ebb335 100644 --- a/SignalServiceKit/src/Network/API/Requests/OWSRequestFactory.m +++ b/SignalServiceKit/src/Network/API/Requests/OWSRequestFactory.m @@ -797,7 +797,7 @@ NSString *const OWSRequestKey_AuthKey = @"AuthKey"; bioEmoji:(nullable ProfileValue *)bioEmoji hasAvatar:(BOOL)hasAvatar paymentAddress:(nullable ProfileValue *)paymentAddress - visibleBadgeIds:(nullable NSArray *)visibleBadgeIds + visibleBadgeIds:(NSArray *)visibleBadgeIds version:(NSString *)version commitment:(NSData *)commitment { @@ -828,9 +828,7 @@ NSString *const OWSRequestKey_AuthKey = @"AuthKey"; OWSAssertDebug(paymentAddress.hasValidBase64Length); parameters[@"paymentAddress"] = paymentAddress.encryptedBase64; } - if (visibleBadgeIds != nil) { - parameters[@"badgeIds"] = visibleBadgeIds; - } + parameters[@"badgeIds"] = [visibleBadgeIds copy]; NSURL *url = [NSURL URLWithString:self.textSecureVersionedProfileAPI]; return [TSRequest requestWithUrl:url diff --git a/SignalServiceKit/src/TSConstants.swift b/SignalServiceKit/src/TSConstants.swift index b63ea7e237..c226b1e7dd 100644 --- a/SignalServiceKit/src/TSConstants.swift +++ b/SignalServiceKit/src/TSConstants.swift @@ -165,21 +165,9 @@ public class TSConstants: NSObject { private class TSConstantsProduction: TSConstantsProtocol { - public var mainServiceWebSocketAPI_identified: String { - FeatureFlags.newHostNames - ? "wss://chat.signal.org/v1/websocket/" - : "wss://textsecure-service.whispersystems.org/v1/websocket/" - } - public var mainServiceWebSocketAPI_unidentified: String { - FeatureFlags.newHostNames - ? "wss://ud-chat.signal.org/v1/websocket/" - : "wss://textsecure-service.whispersystems.org/v1/websocket/" - } - public var mainServiceURL: String { - FeatureFlags.newHostNames - ? "https://chat.signal.org/" - : "https://textsecure-service.whispersystems.org/" - } + public let mainServiceWebSocketAPI_identified = "wss://chat.signal.org/v1/websocket/" + public let mainServiceWebSocketAPI_unidentified = "wss://ud-chat.signal.org/v1/websocket/" + public let mainServiceURL = "https://chat.signal.org/" public let textSecureCDN0ServerURL = "https://cdn.signal.org" public let textSecureCDN2ServerURL = "https://cdn2.signal.org" public let contactDiscoveryURL = "https://api.directory.signal.org" @@ -227,21 +215,9 @@ private class TSConstantsProduction: TSConstantsProtocol { private class TSConstantsStaging: TSConstantsProtocol { - public var mainServiceWebSocketAPI_identified: String { - FeatureFlags.newHostNames - ? "wss://chat.staging.signal.org/v1/websocket/" - : "wss://textsecure-service-staging.whispersystems.org/v1/websocket/" - } - public var mainServiceWebSocketAPI_unidentified: String { - FeatureFlags.newHostNames - ? "wss://ud-chat.staging.signal.org/v1/websocket/" - : "wss://textsecure-service-staging.whispersystems.org/v1/websocket/" - } - public var mainServiceURL: String { - FeatureFlags.newHostNames - ? "https://chat.staging.signal.org/" - : "https://textsecure-service-staging.whispersystems.org/" - } + public let mainServiceWebSocketAPI_identified = "wss://chat.staging.signal.org/v1/websocket/" + public let mainServiceWebSocketAPI_unidentified = "wss://ud-chat.staging.signal.org/v1/websocket/" + public let mainServiceURL = "https://chat.staging.signal.org/" public let textSecureCDN0ServerURL = "https://cdn-staging.signal.org" public let textSecureCDN2ServerURL = "https://cdn2-staging.signal.org" public let contactDiscoveryURL = "https://api-staging.directory.signal.org" diff --git a/SignalServiceKit/src/Util/FeatureFlags.swift b/SignalServiceKit/src/Util/FeatureFlags.swift index e45a7dcdf6..5ac41b59a0 100644 --- a/SignalServiceKit/src/Util/FeatureFlags.swift +++ b/SignalServiceKit/src/Util/FeatureFlags.swift @@ -224,9 +224,6 @@ public class FeatureFlags: BaseFlags { @objc public static let deprecateREST = false - @objc - public static let newHostNames = true - @objc public static let groupRings = false diff --git a/SignalServiceKit/src/Util/Profiles/VersionedProfiles.swift b/SignalServiceKit/src/Util/Profiles/VersionedProfiles.swift index dde9eb4261..ebc38a7d8d 100644 --- a/SignalServiceKit/src/Util/Profiles/VersionedProfiles.swift +++ b/SignalServiceKit/src/Util/Profiles/VersionedProfiles.swift @@ -49,7 +49,7 @@ public protocol VersionedProfilesSwift: VersionedProfiles { profileBio: String?, profileBioEmoji: String?, profileAvatarData: Data?, - visibleBadgeIds: [String]?, + visibleBadgeIds: [String], unsavedRotatedProfileKey: OWSAES256Key?) -> Promise } @@ -75,7 +75,7 @@ public class MockVersionedProfiles: NSObject, VersionedProfilesSwift { profileBio: String?, profileBioEmoji: String?, profileAvatarData: Data?, - visibleBadgeIds: [String]?, + visibleBadgeIds: [String], unsavedRotatedProfileKey: OWSAES256Key?) -> Promise { owsFail("Not implemented.") } diff --git a/SignalServiceKit/src/Util/RemoteConfigManager.swift b/SignalServiceKit/src/Util/RemoteConfigManager.swift index 0129ee3d1d..cc6a09adf9 100644 --- a/SignalServiceKit/src/Util/RemoteConfigManager.swift +++ b/SignalServiceKit/src/Util/RemoteConfigManager.swift @@ -22,7 +22,7 @@ public class RemoteConfig: BaseFlags { self.isEnabledFlags = isEnabledFlags self.valueFlags = valueFlags self.researchMegaphone = Self.isCountryCodeBucketEnabled(.researchMegaphone, valueFlags: valueFlags) - self.subscriptionMegaphone = Self.isCountryCodeBucketEnabled(.subscriptionMegaphone, valueFlags: valueFlags) + self.subscriptionMegaphone = Self.isCountryCodeBucketEnabled(.subscriptionMegaphone2, valueFlags: valueFlags) self.standardMediaQualityLevel = Self.determineStandardMediaQualityLevel(valueFlags: valueFlags) self.paymentsDisabledRegions = Self.parsePaymentsDisabledRegions(valueFlags: valueFlags) } @@ -471,7 +471,7 @@ private struct Flags { case replaceableInteractionExpiration case messageSendLogEntryLifetime case paymentsDisabledRegions - case subscriptionMegaphone + case subscriptionMegaphone2 case subscriptionMegaphoneSnoozeInterval } } diff --git a/SignalShareExtension/Info.plist b/SignalShareExtension/Info.plist index 225d381b83..66fe64b149 100644 --- a/SignalShareExtension/Info.plist +++ b/SignalShareExtension/Info.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString 5.27.0 CFBundleVersion - 34 + 37 ITSAppUsesNonExemptEncryption NSAppTransportSecurity @@ -77,7 +77,7 @@ com.apple.share-services OWSBundleVersion4 - 5.27.0.34 + 5.27.0.37 UIAppFonts fontawesome-webfont.ttf