Merge pull request #956 from oxen-io/dev

Release 2.5.0 (RC2)
master 2.5.0
Morgan Pretty 2 months ago committed by GitHub
commit cfbf0cc7dd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -6694,7 +6694,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 435;
CURRENT_PROJECT_VERSION = 436;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = SUQ8J2PCT7;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
@ -6766,7 +6766,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 435;
CURRENT_PROJECT_VERSION = 436;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = SUQ8J2PCT7;
ENABLE_NS_ASSERTIONS = NO;
@ -6831,7 +6831,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 435;
CURRENT_PROJECT_VERSION = 436;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = SUQ8J2PCT7;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
@ -6905,7 +6905,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 435;
CURRENT_PROJECT_VERSION = 436;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = SUQ8J2PCT7;
ENABLE_NS_ASSERTIONS = NO;
@ -7865,7 +7865,7 @@
CODE_SIGN_ENTITLEMENTS = Session/Meta/Signal.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 435;
CURRENT_PROJECT_VERSION = 436;
DEVELOPMENT_TEAM = SUQ8J2PCT7;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@ -7936,7 +7936,7 @@
CODE_SIGN_ENTITLEMENTS = Session/Meta/Signal.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 435;
CURRENT_PROJECT_VERSION = 436;
DEVELOPMENT_TEAM = SUQ8J2PCT7;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",

@ -132,11 +132,15 @@ final class InfoMessageCell: MessageCell {
)
.adding(
attributes: [ .font: UIFont.boldSystemFont(ofSize: Values.verySmallFontSize) ],
range: (body as NSString).range(of: floor(cellViewModel.threadExpirationTimer ?? 0).formatted(format: .long))
range: (body as NSString).range(of: floor(cellViewModel.expiresInSeconds ?? 0).formatted(format: .long))
)
.adding(
attributes: [ .font: UIFont.boldSystemFont(ofSize: Values.verySmallFontSize) ],
range: (body as NSString).range(of: (cellViewModel.threadExpirationType == .disappearAfterRead ? "DISAPPEARING_MESSAGE_STATE_READ".localized() : "DISAPPEARING_MESSAGE_STATE_SENT".localized()))
range: (body as NSString).range(of: "DISAPPEARING_MESSAGE_STATE_READ".localized())
)
.adding(
attributes: [ .font: UIFont.boldSystemFont(ofSize: Values.verySmallFontSize) ],
range: (body as NSString).range(of: "DISAPPEARING_MESSAGE_STATE_SENT".localized())
)
.adding(
attributes: [ .font: UIFont.boldSystemFont(ofSize: Values.verySmallFontSize) ],

@ -320,6 +320,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
Configuration.performMainSetup()
JobRunner.setExecutor(SyncPushTokensJob.self, for: .syncPushTokens)
/// We need to do a clean up for disappear after send messages that are received by push notifications before
/// the app set up the main screen and load initial data to prevent a case when the PagedDatabaseObserver
/// hasn't been setup yet then the conversation screen can show stale (ie. deleted) interactions incorrectly
DisappearingMessagesJob.cleanExpiredMessagesOnLaunch()
// Setup the UI if needed, then trigger any post-UI setup actions
self.ensureRootViewController(calledFrom: lifecycleMethod) { [weak self] success in
// If we didn't successfully ensure the rootViewController then don't continue as

@ -46,6 +46,24 @@ public enum DisappearingMessagesJob: JobExecutor {
}
}
// MARK: - Clean expired messages on app launch
public extension DisappearingMessagesJob {
static func cleanExpiredMessagesOnLaunch() {
let timestampNowMs: TimeInterval = TimeInterval(SnodeAPI.currentOffsetTimestampMs())
var numDeleted: Int = -1
Storage.shared.write { db in
numDeleted = try Interaction
.filter(Interaction.Columns.expiresStartedAtMs != nil)
.filter((Interaction.Columns.expiresStartedAtMs + (Interaction.Columns.expiresInSeconds * 1000)) <= timestampNowMs)
.deleteAll(db)
}
SNLog("[DisappearingMessagesJob] Deleted \(numDeleted) expired messages on app launch.")
}
}
// MARK: - Convenience
public extension DisappearingMessagesJob {

@ -5,5 +5,5 @@ import Foundation
public final class Features {
public static let useOnionRequests: Bool = true
public static let useTestnet: Bool = false
public static let useNewDisappearingMessagesConfig: Bool = Date().timeIntervalSince1970 > 1710198000
public static let useNewDisappearingMessagesConfig: Bool = Date().timeIntervalSince1970 > 1710284400
}

Loading…
Cancel
Save