Skip to content

Commit

Permalink
Merge branch 'release/1.9.1/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanceriu committed Aug 29, 2022
2 parents 9a2a854 + ed79820 commit 1321dc5
Show file tree
Hide file tree
Showing 52 changed files with 340 additions and 157 deletions.
19 changes: 19 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
## Changes in 1.9.1 (2022-08-29)

🙌 Improvements

- Added Labs flag for the new App Layout. ([#6649](https://github.com/vector-im/element-ios/issues/6649))

🐛 Bugfixes

- Render the PIN entry screen correctly on landscape ([#6629](https://github.com/vector-im/element-ios/pull/6629))
- Ensure rest client async responses are processed on the main queue ([#6642](https://github.com/vector-im/element-ios/pull/6642))
- Stop waiting for biometric unlock if disabled system wide ([#5279](https://github.com/vector-im/element-ios/issues/5279))
- App Layout: added support for transparent avatar icons in the all chats screen ([#6556](https://github.com/vector-im/element-ios/issues/6556))
- App Layout: fixed reactions background in timeline ([#6557](https://github.com/vector-im/element-ios/issues/6557))
- App Layout: Removed Low Priority Rooms from Filters ([#6577](https://github.com/vector-im/element-ios/issues/6577))
- App Layout: Updated missing image for Onboarding screen page 2 ([#6624](https://github.com/vector-im/element-ios/issues/6624))
- App Layout: fixed limited number of invites in the All Chats screen ([#6625](https://github.com/vector-im/element-ios/issues/6625))
- Fix notification issues for threads. ([#6628](https://github.com/vector-im/element-ios/issues/6628))


## Changes in 1.9.0 (2022-08-24)

🙌 Improvements
Expand Down
4 changes: 2 additions & 2 deletions Config/AppVersion.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
//

// Version
MARKETING_VERSION = 1.9.0
CURRENT_PROJECT_VERSION = 1.9.0
MARKETING_VERSION = 1.9.1
CURRENT_PROJECT_VERSION = 1.9.1
7 changes: 5 additions & 2 deletions Config/BuildSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,11 @@ final class BuildSettings: NSObject {
static let syncLocalContacts: Bool = false

// MARK: - New App Layout
static let newAppLayoutEnabled = true

static let newAppLayoutEnabled = false

static var isSideMenuActivated: Bool = enableSideMenu
static var isNewAppLayoutActivated: Bool = newAppLayoutEnabled

// MARK: - Device manager

static let deviceManagerEnabled = false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
{
"images" : [
{
"filename" : "all_chats_onboarding2.svg",
"filename" : "all_chats_onboarding2.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,7 @@
"images" : [
{
"filename" : "all_chats_edit_icon.svg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
"idiom" : "universal"
}
],
"info" : {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,7 @@
"images" : [
{
"filename" : "all_chats_empty_list_placeholder_icon.svg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
"idiom" : "universal"
}
],
"info" : {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,7 @@
"images" : [
{
"filename" : "all_chats_spaces_icon.svg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
"idiom" : "universal"
}
],
"info" : {
Expand Down
1 change: 1 addition & 0 deletions Riot/Assets/en.lproj/Vector.strings
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,7 @@ Tap the + to start adding people.";
"settings_labs_enable_auto_report_decryption_errors" = "Auto Report Decryption Errors";
"settings_labs_use_only_latest_user_avatar_and_name" = "Show latest avatar and name for users in message history";
"settings_labs_enable_live_location_sharing" = "Live location sharing - share current location (active development, and temporarily, locations persist in room history)";
"settings_labs_enable_new_app_layout" = "New Application Layout";

"settings_version" = "Version %@";
"settings_olm_version" = "Olm Version %@";
Expand Down
3 changes: 3 additions & 0 deletions Riot/Categories/MXRestClient+Async.swift
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ extension MXRestClient {

// MARK: - Private

@MainActor
private func getResponse<T>(_ callback: (@escaping (MXResponse<T>) -> Void) -> MXHTTPOperation) async throws -> T {
try await withCheckedThrowingContinuation { continuation in
_ = callback { response in
Expand All @@ -171,6 +172,7 @@ extension MXRestClient {
}
}

@MainActor
private func getResponse<T>(_ callback: (@escaping (T?) -> Void, @escaping (Error?) -> Void) -> MXHTTPOperation) async throws -> T {
try await withCheckedThrowingContinuation { continuation in
_ = callback { response in
Expand All @@ -186,6 +188,7 @@ extension MXRestClient {
}
}

@MainActor
private func getResponse<T, U, V>(_ callback: (@escaping (T?, U?, V?) -> Void, @escaping (Error?) -> Void) -> MXHTTPOperation) async throws -> (T?, U?, V?) {
try await withCheckedThrowingContinuation { continuation in
_ = callback { arg1, arg2, arg3 in
Expand Down
4 changes: 4 additions & 0 deletions Riot/Generated/Strings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7351,6 +7351,10 @@ public class VectorL10n: NSObject {
public static var settingsLabsEnableLiveLocationSharing: String {
return VectorL10n.tr("Vector", "settings_labs_enable_live_location_sharing")
}
/// New Application Layout
public static var settingsLabsEnableNewAppLayout: String {
return VectorL10n.tr("Vector", "settings_labs_enable_new_app_layout")
}
/// Ring for group calls
public static var settingsLabsEnableRingingForGroupCalls: String {
return VectorL10n.tr("Vector", "settings_labs_enable_ringing_for_group_calls")
Expand Down
14 changes: 14 additions & 0 deletions Riot/Managers/Settings/RiotSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ final class RiotSettings: NSObject {

private override init() {
super.init()
BuildSettings.isSideMenuActivated = BuildSettings.enableSideMenu && !newAppLayoutBetaEnabled
BuildSettings.isNewAppLayoutActivated = BuildSettings.newAppLayoutEnabled || newAppLayoutBetaEnabled
}

/// Indicate if UserDefaults suite has been migrated once.
Expand Down Expand Up @@ -381,9 +383,21 @@ final class RiotSettings: NSObject {

@UserDefault(key: "allChatsOnboardingHasBeenDisplayed", defaultValue: false, storage: defaults)
var allChatsOnboardingHasBeenDisplayed

// MARK: - New App Layout
@UserDefault(key: "newAppLayoutBetaEnabled", defaultValue: false, storage: defaults)
var newAppLayoutBetaEnabled {
didSet {
BuildSettings.isSideMenuActivated = BuildSettings.enableSideMenu && !newAppLayoutBetaEnabled
BuildSettings.isNewAppLayoutActivated = BuildSettings.newAppLayoutEnabled || newAppLayoutBetaEnabled
NotificationCenter.default.post(name: RiotSettings.newAppLayoutBetaToggleDidChange, object: self)
}
}

}

// MARK: - RiotSettings notification constants
extension RiotSettings {
public static let didUpdateLiveLocationSharingActivation = Notification.Name("RiotSettingsDidUpdateLiveLocationSharingActivation")
public static let newAppLayoutBetaToggleDidChange = Notification.Name("RiotSettingsNewAppLayoutBetaToggleDidChange")
}
10 changes: 8 additions & 2 deletions Riot/Managers/Theme/Themes/BlackTheme.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,14 @@ class BlackTheme: DarkTheme {
super.init()
self.identifier = ThemeIdentifier.black.rawValue
self.backgroundColor = UIColor(rgb: 0x000000)
self.baseColor = UIColor(rgb: 0x000000)
self.headerBackgroundColor = UIColor(rgb: 0x000000)
self.headerBorderColor = UIColor(rgb: 0x15191E)
}

override var baseColor: UIColor {
UIColor(rgb: 0x000000)
}

override var headerBackgroundColor: UIColor {
UIColor(rgb: 0x000000)
}
}
8 changes: 6 additions & 2 deletions Riot/Managers/Theme/Themes/DarkTheme.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ class DarkTheme: NSObject, Theme {

var backgroundColor: UIColor = UIColor(rgb: 0x15191E)

var baseColor: UIColor = BuildSettings.newAppLayoutEnabled ? UIColor(rgb: 0x15191E) : UIColor(rgb: 0x21262C)
var baseColor: UIColor {
BuildSettings.isNewAppLayoutActivated ? UIColor(rgb: 0x15191E) : UIColor(rgb: 0x21262C)
}
var baseIconPrimaryColor: UIColor = UIColor(rgb: 0xEDF3FF)
var baseTextPrimaryColor: UIColor = UIColor(rgb: 0xFFFFFF)
var baseTextSecondaryColor: UIColor = UIColor(rgb: 0xA9B2BC)
Expand All @@ -35,7 +37,9 @@ class DarkTheme: NSObject, Theme {
var searchPlaceholderColor: UIColor = UIColor(rgb: 0xA9B2BC)
var searchResultHighlightColor: UIColor = UIColor(rgb: 0xFCC639).withAlphaComponent(0.3)

var headerBackgroundColor: UIColor = BuildSettings.newAppLayoutEnabled ? UIColor(rgb: 0x15191E) : UIColor(rgb: 0x21262C)
var headerBackgroundColor: UIColor {
BuildSettings.isNewAppLayoutActivated ? UIColor(rgb: 0x15191E) : UIColor(rgb: 0x21262C)
}
var headerBorderColor: UIColor = UIColor(rgb: 0x15191E)
var headerTextPrimaryColor: UIColor = UIColor(rgb: 0xFFFFFF)
var headerTextSecondaryColor: UIColor = UIColor(rgb: 0xA9B2BC)
Expand Down
10 changes: 7 additions & 3 deletions Riot/Managers/Theme/Themes/DefaultTheme.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ class DefaultTheme: NSObject, Theme {

var backgroundColor: UIColor = UIColor(rgb: 0xFFFFFF)

var baseColor: UIColor = BuildSettings.newAppLayoutEnabled ? UIColor(rgb: 0xFFFFFF) : UIColor(rgb: 0xF5F7FA)
var baseColor: UIColor {
BuildSettings.isNewAppLayoutActivated ? UIColor(rgb: 0xFFFFFF) : UIColor(rgb: 0xF5F7FA)
}
var baseIconPrimaryColor: UIColor = UIColor(rgb: 0xFFFFFF)
var baseTextPrimaryColor: UIColor = UIColor(rgb: 0xFFFFFF)
var baseTextSecondaryColor: UIColor = UIColor(rgb: 0x8F97A3)
Expand All @@ -35,7 +37,9 @@ class DefaultTheme: NSObject, Theme {
var searchPlaceholderColor: UIColor = UIColor(rgb: 0x8F97A3)
var searchResultHighlightColor: UIColor = UIColor(rgb: 0xFCC639).withAlphaComponent(0.2)

var headerBackgroundColor: UIColor = BuildSettings.newAppLayoutEnabled ? UIColor(rgb: 0xFFFFFF) : UIColor(rgb: 0xF5F7FA)
var headerBackgroundColor: UIColor {
BuildSettings.isNewAppLayoutActivated ? UIColor(rgb: 0xFFFFFF) : UIColor(rgb: 0xF5F7FA)
}
var headerBorderColor: UIColor = UIColor(rgb: 0xE9EDF1)
var headerTextPrimaryColor: UIColor = UIColor(rgb: 0x17191C)
var headerTextSecondaryColor: UIColor = UIColor(rgb: 0x737D8C)
Expand Down Expand Up @@ -169,7 +173,7 @@ class DefaultTheme: NSObject, Theme {
searchBar.backgroundImage = UIImage() // Remove top and bottom shadow
searchBar.tintColor = self.tintColor

guard !BuildSettings.newAppLayoutEnabled else {
guard !BuildSettings.isNewAppLayoutActivated else {
return
}

Expand Down
1 change: 1 addition & 0 deletions Riot/Modules/Analytics/SentryMonitoringClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ struct SentryMonitoringClient {
options.dsn = Self.sentryDSN

// Collecting only 10% of all events
options.sampleRate = 0.1
options.tracesSampleRate = 0.1

options.beforeSend = { event in
Expand Down
10 changes: 9 additions & 1 deletion Riot/Modules/Application/AppCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ final class AppCoordinator: NSObject, AppCoordinatorType {
// Setup user location services
_ = UserLocationServiceProvider.shared

if BuildSettings.enableSideMenu {
if BuildSettings.isSideMenuActivated {
self.addSideMenu()
}

Expand All @@ -105,6 +105,8 @@ final class AppCoordinator: NSObject, AppCoordinatorType {
}
}

NotificationCenter.default.addObserver(self, selector: #selector(self.newAppLayoutToggleDidChange(notification:)), name: RiotSettings.newAppLayoutBetaToggleDidChange, object: nil)

// NOTE: When split view is shown there can be no Matrix sessions ready. Keep this behavior or use a loading screen before showing the split view.
self.showSplitView()
MXLog.debug("[AppCoordinator] Showed split view")
Expand Down Expand Up @@ -160,6 +162,12 @@ final class AppCoordinator: NSObject, AppCoordinatorType {
ThemePublisher.shared.republish(themeIdPublisher: themeIdPublisher)
}

@objc private func newAppLayoutToggleDidChange(notification: Notification) {
if BuildSettings.isSideMenuActivated {
self.addSideMenu()
}
}

private func excludeAllItemsFromBackup() {
let manager = FileManager.default

Expand Down
65 changes: 55 additions & 10 deletions Riot/Modules/Application/LegacyAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -1114,21 +1114,66 @@ - (void)pushNotificationService:(PushNotificationService *)pushNotificationServi
threadId:(NSString *)threadId
sender:(NSString *)userId
{
if (roomId)
{
MXRoom *room = [self.mxSessions.firstObject roomWithRoomId:roomId];
if (room.summary.membership != MXMembershipJoin)
void(^sessionReadyBlock)(MXSession*) = ^(MXSession *session){
if (roomId)
{
MXRoom *room = [session roomWithRoomId:roomId];
if (room.summary.membership != MXMembershipJoin)
{
Analytics.shared.joinedRoomTrigger = AnalyticsJoinedRoomTriggerNotification;
}
else
{
Analytics.shared.viewRoomTrigger = AnalyticsViewRoomTriggerNotification;
}
}

self.lastNavigatedRoomIdFromPush = roomId;

if (threadId)
{
Analytics.shared.joinedRoomTrigger = AnalyticsJoinedRoomTriggerNotification;
if(![[MXKRoomDataSourceManager sharedManagerForMatrixSession:session] hasRoomDataSourceForRoom:roomId])
{
// the room having this thread probably was not opened before, paginate room messages to build threads
MXRoom *room = [session roomWithRoomId:roomId];
[room liveTimeline:^(id<MXEventTimeline> liveTimeline) {
[liveTimeline resetPagination];
[liveTimeline paginate:NSUIntegerMax direction:MXTimelineDirectionBackwards onlyFromStore:YES complete:^{
[liveTimeline resetPagination];
[self navigateToRoomById:roomId threadId:threadId sender:userId];
} failure:^(NSError * _Nonnull error) {
[self navigateToRoomById:roomId threadId:threadId sender:userId];
}];
}];
}
else
{
// the room has been opened before, we should be ok to continue
[self navigateToRoomById:roomId threadId:threadId sender:userId];
}
}
else
{
Analytics.shared.viewRoomTrigger = AnalyticsViewRoomTriggerNotification;
[self navigateToRoomById:roomId threadId:threadId sender:userId];
}
}
};

_lastNavigatedRoomIdFromPush = roomId;
[self navigateToRoomById:roomId threadId:threadId sender:userId];
MXSession *mxSession = self.mxSessions.firstObject;
if (mxSession.state >= MXSessionStateSyncInProgress)
{
sessionReadyBlock(mxSession);
}
else
{
// wait for session state to be sync in progress
__block id sessionStateObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kMXSessionStateDidChangeNotification object:mxSession queue:nil usingBlock:^(NSNotification * _Nonnull note) {
if (mxSession.state >= MXSessionStateSyncInProgress)
{
[[NSNotificationCenter defaultCenter] removeObserver:sessionStateObserver];
sessionReadyBlock(mxSession);
}
}];
}
}

#pragma mark - Badge Count
Expand Down Expand Up @@ -4212,7 +4257,7 @@ - (void)setupUserDefaults
}

// Need to set `showAllRoomsInHomeSpace` to `true` for the new App Layout
if (BuildSettings.newAppLayoutEnabled)
if (BuildSettings.isNewAppLayoutActivated)
{
RiotSettings.shared.showAllRoomsInHomeSpace = YES;
}
Expand Down
Loading

0 comments on commit 1321dc5

Please sign in to comment.