Skip to content

Commit

Permalink
Merge branch 'release/1.10.2/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
pixlwave committed Feb 10, 2023
2 parents 50f1fc8 + 677493f commit aaadcc7
Show file tree
Hide file tree
Showing 12 changed files with 116 additions and 60 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/release-alpha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,17 @@ on:

# Triggers the workflow on any pull request
pull_request:

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
types: [ labeled, synchronize, opened, reopened ]

env:
# Make the git branch for a PR available to our Fastfile
MX_GIT_BRANCH: ${{ github.event.pull_request.head.ref }}

jobs:
build:
# Don't run for forks as secrets are unavailable.
if: |
github.event.pull_request.head.repo.full_name == github.repository &&
(github.event_name == 'push' ||
(github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'Trigger-PR-Build')))
# Only run for PRs that contain the trigger label. The action will fail for forks due to
# missing secrets, but there's no need to handle this as it won't run automatically.
if: contains(github.event.pull_request.labels.*.name, 'Trigger-PR-Build')

name: Release
runs-on: macos-12
Expand Down
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## Changes in 1.10.2 (2023-02-10)

🐛 Bugfixes

- Fixes #7350 - Fix green dot only to appear for marked action ([#7530](https://github.com/vector-im/element-ios/issues/7530))


## Changes in 1.10.1 (2023-02-07)

✨ Features
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.10.1
CURRENT_PROJECT_VERSION = 1.10.1
MARKETING_VERSION = 1.10.2
CURRENT_PROJECT_VERSION = 1.10.2
4 changes: 2 additions & 2 deletions Riot/Categories/MXBugReportRestClient+Riot.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ extension MXBugReportRestClient {
// User info (TODO: handle multi-account and find a way to expose them in rageshake API)
var userInfo = [String: String]()
let mainAccount = MXKAccountManager.shared().accounts.first
if let userId = mainAccount?.mxSession.myUser.userId {
if let userId = mainAccount?.mxSession?.myUser?.userId {
userInfo["user_id"] = userId
}
if let deviceId = mainAccount?.mxSession.matrixRestClient.credentials.deviceId {
if let deviceId = mainAccount?.mxSession?.myDeviceId {
userInfo["device_id"] = deviceId
}

Expand Down
15 changes: 9 additions & 6 deletions Riot/Modules/Common/Recents/Views/RecentTableViewCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,17 @@ - (void)render:(MXKCellData *)cellData
self.lastEventDecriptionLabelTrailingConstraint.constant = self.unsentImageView.hidden ? 10 : 30;

// Notify unreads and bing
if (roomCellData.hasUnread)
if (roomCellData.isRoomMarkedAsUnread)
{

self.missedNotifAndUnreadBadgeBgView.hidden = NO;
self.missedNotifAndUnreadBadgeBgView.backgroundColor = ThemeService.shared.theme.tintColor;
self.missedNotifAndUnreadBadgeBgViewWidthConstraint.constant = 20;
}
else if (roomCellData.hasUnread)
{
self.missedNotifAndUnreadIndicator.hidden = NO;
if (0 < roomCellData.notificationCount)
{
self.missedNotifAndUnreadIndicator.hidden = NO;
self.missedNotifAndUnreadIndicator.backgroundColor = roomCellData.highlightCount ? ThemeService.shared.theme.noticeColor : ThemeService.shared.theme.noticeSecondaryColor;

self.missedNotifAndUnreadBadgeBgView.hidden = NO;
Expand All @@ -110,9 +115,7 @@ - (void)render:(MXKCellData *)cellData
}
else
{
self.missedNotifAndUnreadBadgeBgView.hidden = NO;
self.missedNotifAndUnreadBadgeBgView.backgroundColor = ThemeService.shared.theme.tintColor;
self.missedNotifAndUnreadBadgeBgViewWidthConstraint.constant = 20;
self.missedNotifAndUnreadIndicator.backgroundColor = ThemeService.shared.theme.unreadRoomIndentColor;
}

// Use bold font for the room title
Expand Down
28 changes: 16 additions & 12 deletions Riot/Modules/Home/AllChats/AllChatsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ class AllChatsViewController: HomeViewController {
searchController.isActive = false

guard let spaceId = spaceId else {
self.dataSource?.currentSpace = nil
dataSource?.currentSpace = nil
updateUI()

return
Expand All @@ -207,7 +207,7 @@ class AllChatsViewController: HomeViewController {
return
}

self.dataSource.currentSpace = space
dataSource?.currentSpace = space
updateUI()

self.recentsTableView.scrollToRow(at: IndexPath(row: 0, section: 0), at: .top, animated: true)
Expand Down Expand Up @@ -288,7 +288,7 @@ class AllChatsViewController: HomeViewController {

@objc private func showSpaceSelectorAction(sender: AnyObject) {
Analytics.shared.viewRoomTrigger = .roomList
let currentSpaceId = self.dataSource.currentSpace?.spaceId ?? SpaceSelectorConstants.homeSpaceId
let currentSpaceId = dataSource?.currentSpace?.spaceId ?? SpaceSelectorConstants.homeSpaceId
let spaceSelectorBridgePresenter = SpaceSelectorBottomSheetCoordinatorBridgePresenter(session: self.mainSession, selectedSpaceId: currentSpaceId, showHomeSpace: true)
spaceSelectorBridgePresenter.present(from: self, animated: true)
spaceSelectorBridgePresenter.delegate = self
Expand All @@ -310,14 +310,18 @@ class AllChatsViewController: HomeViewController {
return super.tableView(tableView, numberOfRowsInSection: section)
}

return dataSource.tableView(tableView, numberOfRowsInSection: section)
return dataSource?.tableView(tableView, numberOfRowsInSection: section) ?? 0
}

override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
guard let sectionType = sectionType(forSectionAt: indexPath.section), sectionType == .invites else {
return super.tableView(tableView, cellForRowAt: indexPath)
}

guard let dataSource = dataSource else {
MXLog.failure("Missing data source")
return UITableViewCell()
}
return dataSource.tableView(tableView, cellForRowAt: indexPath)
}

Expand All @@ -328,7 +332,7 @@ class AllChatsViewController: HomeViewController {
return super.tableView(tableView, heightForRowAt: indexPath)
}

return dataSource.cellHeight(at: indexPath)
return dataSource?.cellHeight(at: indexPath) ?? 0
}

override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
Expand Down Expand Up @@ -583,7 +587,7 @@ class AllChatsViewController: HomeViewController {
}

private func showSpaceInvite() {
guard let session = mainSession, let spaceRoom = dataSource.currentSpace?.room else {
guard let session = mainSession, let spaceRoom = dataSource?.currentSpace?.room else {
return
}

Expand All @@ -595,7 +599,7 @@ class AllChatsViewController: HomeViewController {
}

private func showSpaceMembers() {
guard let session = mainSession, let spaceId = dataSource.currentSpace?.spaceId else {
guard let session = mainSession, let spaceId = dataSource?.currentSpace?.spaceId else {
return
}

Expand All @@ -609,7 +613,7 @@ class AllChatsViewController: HomeViewController {
}

private func showSpaceSettings() {
guard let session = mainSession, let spaceId = dataSource.currentSpace?.spaceId else {
guard let session = mainSession, let spaceId = dataSource?.currentSpace?.spaceId else {
return
}

Expand All @@ -630,7 +634,7 @@ class AllChatsViewController: HomeViewController {
}

private func showLeaveSpace() {
guard let session = mainSession, let spaceSummary = dataSource.currentSpace?.summary else {
guard let session = mainSession, let spaceSummary = dataSource?.currentSpace?.summary else {
return
}

Expand Down Expand Up @@ -714,11 +718,11 @@ extension AllChatsViewController: SpaceSelectorBottomSheetCoordinatorBridgePrese
extension AllChatsViewController: UISearchResultsUpdating {
func updateSearchResults(for searchController: UISearchController) {
guard let searchText = searchController.searchBar.text, !searchText.isEmpty else {
self.dataSource.search(withPatterns: nil)
self.dataSource?.search(withPatterns: nil)
return
}

self.dataSource.search(withPatterns: [searchText])
self.dataSource?.search(withPatterns: [searchText])
}
}

Expand Down Expand Up @@ -754,7 +758,7 @@ extension AllChatsViewController: AllChatsEditActionProviderDelegate {
case .startChat:
startChat()
case .createSpace:
showCreateSpace(parentSpaceId: dataSource.currentSpace?.spaceId)
showCreateSpace(parentSpaceId: dataSource?.currentSpace?.spaceId)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ final class KeyVerificationSelfVerifyWaitCoordinator: KeyVerificationSelfVerifyW

// MARK: Private

private let session: MXSession
private var keyVerificationSelfVerifyWaitViewModel: KeyVerificationSelfVerifyWaitViewModelType
private let keyVerificationSelfVerifyWaitViewController: KeyVerificationSelfVerifyWaitViewController
private let cancellable: Bool
Expand All @@ -40,9 +39,7 @@ final class KeyVerificationSelfVerifyWaitCoordinator: KeyVerificationSelfVerifyW
// MARK: - Setup

init(session: MXSession, isNewSignIn: Bool, cancellable: Bool) {
self.session = session

let keyVerificationSelfVerifyWaitViewModel = KeyVerificationSelfVerifyWaitViewModel(session: self.session, isNewSignIn: isNewSignIn)
let keyVerificationSelfVerifyWaitViewModel = KeyVerificationSelfVerifyWaitViewModel(session: session, isNewSignIn: isNewSignIn)
let keyVerificationSelfVerifyWaitViewController = KeyVerificationSelfVerifyWaitViewController.instantiate(with: keyVerificationSelfVerifyWaitViewModel, cancellable: cancellable)
self.keyVerificationSelfVerifyWaitViewModel = keyVerificationSelfVerifyWaitViewModel
self.keyVerificationSelfVerifyWaitViewController = keyVerificationSelfVerifyWaitViewController
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,19 @@ final class KeyVerificationSelfVerifyWaitViewModel: KeyVerificationSelfVerifyWai

private let session: MXSession
private let keyVerificationService: KeyVerificationService
private let verificationManager: MXKeyVerificationManager
private let verificationManager: MXKeyVerificationManager?
private let isNewSignIn: Bool
private var secretsRecoveryAvailability: SecretsRecoveryAvailability
private var secretsRecoveryAvailability: SecretsRecoveryAvailability?
private var keyVerificationRequest: MXKeyVerificationRequest?

private var myUserId: String {
guard let userId = session.myUserId else {
MXLog.error("[KeyVerificationSelfVerifyWaitViewModel] userId is missing")
return ""
}
return userId
}

// MARK: Public

weak var viewDelegate: KeyVerificationSelfVerifyWaitViewModelViewDelegate?
Expand All @@ -40,10 +48,10 @@ final class KeyVerificationSelfVerifyWaitViewModel: KeyVerificationSelfVerifyWai

init(session: MXSession, isNewSignIn: Bool) {
self.session = session
self.verificationManager = session.crypto.keyVerificationManager
self.verificationManager = session.crypto?.keyVerificationManager
self.keyVerificationService = KeyVerificationService()
self.isNewSignIn = isNewSignIn
self.secretsRecoveryAvailability = session.crypto.recoveryService.vc_availability
self.secretsRecoveryAvailability = session.crypto?.recoveryService.vc_availability
}

deinit {
Expand All @@ -59,9 +67,16 @@ final class KeyVerificationSelfVerifyWaitViewModel: KeyVerificationSelfVerifyWai
case .cancel:
self.cancel()
case .recoverSecrets:
switch self.secretsRecoveryAvailability {
guard let availability = secretsRecoveryAvailability else {
MXLog.error("[KeyVerificationSelfVerifyWaitViewModel] process: secretsRecoveryAvailability not set")
self.cancel()
return
}

switch availability {
case .notAvailable:
fatalError("Should not happen: When recovery is not available button is hidden")
MXLog.error("Should not happen: When recovery is not available button is hidden")
self.cancel()
case .available(let secretsRecoveryMode):
self.coordinatorDelegate?.keyVerificationSelfVerifyWaitViewModel(self, wantsToRecoverSecretsWith: secretsRecoveryMode)
}
Expand All @@ -71,12 +86,16 @@ final class KeyVerificationSelfVerifyWaitViewModel: KeyVerificationSelfVerifyWai
// MARK: - Private

private func loadData() {
guard let verificationManager = verificationManager else {
MXLog.failure("Verification manager is not set")
return
}

if !self.isNewSignIn {
MXLog.debug("[KeyVerificationSelfVerifyWaitViewModel] loadData: Send a verification request to all devices")

let keyVerificationService = KeyVerificationService()
self.verificationManager.requestVerificationByToDevice(withUserId: self.session.myUserId, deviceIds: nil, methods: keyVerificationService.supportedKeyVerificationMethods(), success: { [weak self] (keyVerificationRequest) in
verificationManager.requestVerificationByToDevice(withUserId: self.myUserId, deviceIds: nil, methods: keyVerificationService.supportedKeyVerificationMethods(), success: { [weak self] (keyVerificationRequest) in
guard let self = self else {
return
}
Expand All @@ -103,7 +122,7 @@ final class KeyVerificationSelfVerifyWaitViewModel: KeyVerificationSelfVerifyWai
MXLog.debug("[KeyVerificationSelfVerifyWaitViewModel] loadData: Send a verification request to all devices instead of waiting")

let keyVerificationService = KeyVerificationService()
self.verificationManager.requestVerificationByToDevice(withUserId: self.session.myUserId, deviceIds: nil, methods: keyVerificationService.supportedKeyVerificationMethods(), success: { [weak self] (keyVerificationRequest) in
verificationManager.requestVerificationByToDevice(withUserId: self.myUserId, deviceIds: nil, methods: keyVerificationService.supportedKeyVerificationMethods(), success: { [weak self] (keyVerificationRequest) in
guard let self = self else {
return
}
Expand Down Expand Up @@ -132,12 +151,18 @@ final class KeyVerificationSelfVerifyWaitViewModel: KeyVerificationSelfVerifyWai
}

private func continueLoadData() {
guard let verificationManager = verificationManager, let recoveryService = session.crypto?.recoveryService else {
MXLog.error("[KeyVerificationSelfVerifyWaitViewModel] continueLoadData: Missing dependencies")
return
}

// update availability again
self.secretsRecoveryAvailability = session.crypto.recoveryService.vc_availability
let availability = recoveryService.vc_availability
self.secretsRecoveryAvailability = availability

let viewData = KeyVerificationSelfVerifyWaitViewData(isNewSignIn: self.isNewSignIn, secretsRecoveryAvailability: self.secretsRecoveryAvailability)
let viewData = KeyVerificationSelfVerifyWaitViewData(isNewSignIn: self.isNewSignIn, secretsRecoveryAvailability: availability)

self.registerKeyVerificationManagerNewRequestNotification(for: self.verificationManager)
self.registerKeyVerificationManagerNewRequestNotification(for: verificationManager)
self.update(viewState: .loaded(viewData))
self.registerTransactionDidStateChangeNotification()
self.registerKeyVerificationRequestChangeNotification()
Expand Down Expand Up @@ -251,7 +276,7 @@ final class KeyVerificationSelfVerifyWaitViewModel: KeyVerificationSelfVerifyWai

@objc private func transactionDidStateChange(notification: Notification) {
guard let sasTransaction = notification.object as? MXSASTransaction,
sasTransaction.isIncoming, sasTransaction.otherUserId == self.session.myUserId else {
sasTransaction.isIncoming, sasTransaction.otherUserId == self.myUserId else {
return
}
self.sasTransactionDidStateChange(sasTransaction)
Expand Down
25 changes: 20 additions & 5 deletions Riot/Modules/MatrixKit/Models/Room/MXKRoomDataSource.m
Original file line number Diff line number Diff line change
Expand Up @@ -2150,7 +2150,10 @@ - (void)resendEventWithEventId:(NSString *)eventId success:(void (^)(NSString *)
}
else
{
failure([NSError errorWithDomain:MXKRoomDataSourceErrorDomain code:MXKRoomDataSourceErrorResendGeneric userInfo:nil]);
if (failure)
{
failure([NSError errorWithDomain:MXKRoomDataSourceErrorDomain code:MXKRoomDataSourceErrorResendGeneric userInfo:nil]);
}
MXLogWarning(@"[MXKRoomDataSource][%p] resendEventWithEventId: Warning - Unable to resend room message of type: %@", self, msgType);
}
}
Expand All @@ -2177,7 +2180,10 @@ - (void)resendEventWithEventId:(NSString *)eventId success:(void (^)(NSString *)
NSURL *localFileURL = [NSURL URLWithString:localFilePath];

if (![NSFileManager.defaultManager fileExistsAtPath:localFilePath]) {
failure([NSError errorWithDomain:MXKRoomDataSourceErrorDomain code:MXKRoomDataSourceErrorResendInvalidLocalFilePath userInfo:nil]);
if (failure)
{
failure([NSError errorWithDomain:MXKRoomDataSourceErrorDomain code:MXKRoomDataSourceErrorResendInvalidLocalFilePath userInfo:nil]);
}
MXLogWarning(@"[MXKRoomDataSource][%p] resendEventWithEventId: Warning - Unable to resend voice message, invalid file path.", self);
return;
}
Expand Down Expand Up @@ -2247,7 +2253,10 @@ - (void)resendEventWithEventId:(NSString *)eventId success:(void (^)(NSString *)
}
else
{
failure([NSError errorWithDomain:MXKRoomDataSourceErrorDomain code:MXKRoomDataSourceErrorResendGeneric userInfo:nil]);
if (failure)
{
failure([NSError errorWithDomain:MXKRoomDataSourceErrorDomain code:MXKRoomDataSourceErrorResendGeneric userInfo:nil]);
}
MXLogWarning(@"[MXKRoomDataSource][%p] resendEventWithEventId: Warning - Unable to resend room message of type: %@", self, msgType);
}
}
Expand All @@ -2259,13 +2268,19 @@ - (void)resendEventWithEventId:(NSString *)eventId success:(void (^)(NSString *)
}
else
{
failure([NSError errorWithDomain:MXKRoomDataSourceErrorDomain code:MXKRoomDataSourceErrorResendInvalidMessageType userInfo:nil]);
if (failure)
{
failure([NSError errorWithDomain:MXKRoomDataSourceErrorDomain code:MXKRoomDataSourceErrorResendInvalidMessageType userInfo:nil]);
}
MXLogWarning(@"[MXKRoomDataSource][%p] resendEventWithEventId: Warning - Unable to resend room message of type: %@", self, msgType);
}
}
else
{
failure([NSError errorWithDomain:MXKRoomDataSourceErrorDomain code:MXKRoomDataSourceErrorResendInvalidMessageType userInfo:nil]);
if (failure)
{
failure([NSError errorWithDomain:MXKRoomDataSourceErrorDomain code:MXKRoomDataSourceErrorResendInvalidMessageType userInfo:nil]);
}
MXLogWarning(@"[MXKRoomDataSource][%p] MXKRoomDataSource: Warning - Only resend of MXEventTypeRoomMessage is allowed. Event.type: %@", self, event.type);
}
}
Expand Down
Loading

0 comments on commit aaadcc7

Please sign in to comment.