Merge branch 'develop' into element_3579

# Conflicts:
#	CHANGES.rst
This commit is contained in:
ismailgulek 2020-10-22 17:30:54 +03:00
commit 09269e18ff
9 changed files with 56 additions and 161 deletions

View file

@ -6,7 +6,13 @@ Changes to be released in next version
🙌 Improvements
* Secure backup: Add possibility to not expose recovery key when creating a secure backup.
* NSE: Background sync and store/aggregate sync responses on pushes, to make messages available when the app is foregrounded (#3579).
* Update GBDeviceInfo to 6.4.0 (#3570).
* Update FlowCommoniOS to 1.9.0 (#3570).
* Update KeychainAccess to 4.2.1 (#3570).
* Update MatomoTracker to 7.2.2 (#3570).
* Update SwiftGen to 6.3.0 (#3570).
* Update SwiftLint to 0.40.3 (#3570).
* NSE: Utilize MXBackgroundService on pushes, to make messages available when the app is foregrounded (#3579).
🐛 Bugfix
*

12
Podfile
View file

@ -49,12 +49,12 @@ end
abstract_target 'RiotPods' do
pod 'GBDeviceInfo', '~> 6.3.0'
pod 'GBDeviceInfo', '~> 6.4.0'
pod 'Reusable', '~> 4.1'
pod 'KeychainAccess', '~> 4.2'
pod 'KeychainAccess', '~> 4.2.1'
# Piwik for analytics
pod 'MatomoTracker', '~> 7.2.0'
pod 'MatomoTracker', '~> 7.2.2'
# Remove warnings from "bad" pods
pod 'OLMKit', :inhibit_warnings => true
@ -63,15 +63,15 @@ abstract_target 'RiotPods' do
pod 'HPGrowingTextView', :inhibit_warnings => true
# Tools
pod 'SwiftGen', '~> 6.1'
pod 'SwiftLint', '~> 0.36.0'
pod 'SwiftGen', '~> 6.3'
pod 'SwiftLint', '~> 0.40.3'
target "Riot" do
import_MatrixKit
pod 'DGCollectionViewLeftAlignFlowLayout', '~> 1.0.4'
pod 'KTCenterFlowLayout', '~> 1.3.1'
pod 'ZXingObjC', '~> 3.6.5'
pod 'FlowCommoniOS', '~> 1.8.7'
pod 'FlowCommoniOS', '~> 1.9.0'
pod 'ReadMoreTextView', '~> 3.0.1'
target 'RiotTests' do

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="16097.2" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="H1p-Uh-vWS">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="16096" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="H1p-Uh-vWS">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
@ -45,12 +45,9 @@
</navigationItem>
<connections>
<outlet property="roomTitleViewContainer" destination="aas-th-FW1" id="SFz-1s-ywg"/>
<segue destination="e7G-NU-7ck" kind="show" identifier="showRoomDetails" id="vCz-dl-6xQ"/>
<segue destination="KDg-aD-xlK" kind="show" identifier="showRoomSearch" id="hdA-V1-9AF"/>
<segue destination="nDS-pp-sWM" kind="show" identifier="showMemberDetails" id="cUw-vU-gJq"/>
<segue destination="gkO-rP-nGK" kind="show" identifier="showContactDetails" id="f5u-Y1-7nt"/>
<segue destination="ZZb-IS-a1F" kind="presentation" identifier="showUnknownDevices" id="wUx-4y-ybn"/>
<segue destination="udm-55-AMb" kind="show" identifier="showContactPicker" id="Q6y-9M-Ugl"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="94y-cU-qQD" userLabel="First Responder" sceneMemberID="firstResponder"/>
@ -66,7 +63,7 @@
<viewControllerLayoutGuide type="bottom" id="6ie-9b-cBo"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="N8z-LO-417">
<rect key="frame" x="0.0" y="0.0" width="375" height="647"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
@ -89,9 +86,7 @@
</navigationItem>
<connections>
<outlet property="roomTitleViewContainer" destination="djN-zB-Vni" id="VQG-Mp-hSa"/>
<segue destination="nDS-pp-sWM" kind="show" identifier="showMemberDetails" id="fNQ-S3-DbZ"/>
<segue destination="gkO-rP-nGK" kind="show" identifier="showContactDetails" id="ziz-Xl-QVg"/>
<segue destination="e7G-NU-7ck" kind="show" identifier="showRoomDetails" id="mFs-HA-7Oo"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Yjg-uP-Hcy" userLabel="First Responder" sceneMemberID="firstResponder"/>
@ -564,7 +559,7 @@
<viewControllerLayoutGuide type="bottom" id="7q1-ig-sPp"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="6G9-nj-ktC">
<rect key="frame" x="0.0" y="0.0" width="375" height="647"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</view>
@ -595,9 +590,7 @@
</scenes>
<inferredMetricsTieBreakers>
<segue reference="mhb-l9-pM3"/>
<segue reference="f5u-Y1-7nt"/>
<segue reference="vCz-dl-6xQ"/>
<segue reference="cUw-vU-gJq"/>
<segue reference="ziz-Xl-QVg"/>
</inferredMetricsTieBreakers>
<resources>
<image name="integrations_icon" width="24" height="24"/>

View file

@ -143,7 +143,8 @@ internal struct ImageAsset {
#if os(iOS) || os(tvOS)
let image = Image(named: name, in: bundle, compatibleWith: nil)
#elseif os(macOS)
let image = bundle.image(forResource: NSImage.Name(name))
let name = NSImage.Name(self.name)
let image = (bundle == .main) ? NSImage(named: name) : bundle.image(forResource: name)
#elseif os(watchOS)
let image = Image(named: name)
#endif

View file

@ -52,8 +52,7 @@ internal enum InfoPlist {
// MARK: - Implementation Details
private func arrayFromPlist<T>(at path: String) -> [T] {
let bundle = BundleToken.bundle
guard let url = bundle.url(forResource: path, withExtension: nil),
guard let url = BundleToken.bundle.url(forResource: path, withExtension: nil),
let data = NSArray(contentsOf: url) as? [T] else {
fatalError("Unable to load PLIST at path: \(path)")
}
@ -64,8 +63,7 @@ private struct PlistDocument {
let data: [String: Any]
init(path: String) {
let bundle = BundleToken.bundle
guard let url = bundle.url(forResource: path, withExtension: nil),
guard let url = BundleToken.bundle.url(forResource: path, withExtension: nil),
let data = NSDictionary(contentsOf: url) as? [String: Any] else {
fatalError("Unable to load PLIST at path: \(path)")
}

View file

@ -552,6 +552,10 @@
[mainNavigationController.navigationBar setShadowImage:nil];
[mainNavigationController.navigationBar setBackgroundImage:nil forBarMetrics:UIBarMetricsDefault];
}
// Main Navigation bar opacity must follow
self.navigationController.navigationBar.translucent = isHidden;
mainNavigationController.navigationBar.translucent = isHidden;
}
#pragma mark - TableView data source

View file

@ -188,7 +188,9 @@
[tableView deselectRowAtIndexPath:indexPath animated:YES];
// Make the master tabBar view controller open the RoomViewController
[[AppDelegate theDelegate].masterTabBarController performSegueWithIdentifier:@"showRoomDetails" sender:self];
[[AppDelegate theDelegate].masterTabBarController selectRoomWithId:cellData.roomId
andEventId:_selectedEvent.eventId
inMatrixSession:self.mainSession];
// Reset the selected event. HomeViewController got it when here
_selectedEvent = nil;

View file

@ -239,8 +239,10 @@
[tableView deselectRowAtIndexPath:indexPath animated:YES];
// Make the master tabBar view controller open the RoomViewController
[[AppDelegate theDelegate].masterTabBarController performSegueWithIdentifier:@"showRoomDetails" sender:self];
[[AppDelegate theDelegate].masterTabBarController selectRoomWithId:cellData.roomId
andEventId:_selectedEvent.eventId
inMatrixSession:cellData.mxSession];
// Reset the selected event. HomeViewController got it when here
_selectedEvent = nil;
}

View file

@ -135,9 +135,6 @@
// The customized room data source for Vector
RoomDataSource *customizedRoomDataSource;
// The user taps on a member thumbnail
MXRoomMember *selectedRoomMember;
// The user taps on a user id contained in a message
MXKContact *selectedContact;
@ -147,14 +144,6 @@
// Typing notifications listener.
id typingNotifListener;
// The first tab is selected by default in room details screen in case of 'showRoomDetails' segue.
// Use this flag to select a specific tab (0: people, 1: files, 2: settings).
NSUInteger selectedRoomDetailsIndex;
// No field is selected by default in room details screen in case of 'showRoomDetails' segue.
// Use this value to select a specific field in room settings.
RoomSettingsViewControllerField selectedRoomSettingsField;
// The position of the first touch down event stored in case of scrolling when the expanded header is visible.
CGPoint startScrollingPoint;
@ -367,6 +356,8 @@
[self.bubblesTableView registerClass:RoomCreationCollapsedBubbleCell.class forCellReuseIdentifier:RoomCreationCollapsedBubbleCell.defaultReuseIdentifier];
[self.bubblesTableView registerClass:RoomCreationWithPaginationCollapsedBubbleCell.class forCellReuseIdentifier:RoomCreationWithPaginationCollapsedBubbleCell.defaultReuseIdentifier];
[self vc_removeBackTitle];
// Replace the default input toolbar view.
// Note: this operation will force the layout of subviews. That is why cell view classes must be registered before.
[self updateRoomInputToolbarViewClassIfNeeded];
@ -1623,6 +1614,24 @@
[self.roomCreationModalCoordinatorBridgePresenter presentFrom:self animated:YES];
}
- (void)showMemberDetails:(MXRoomMember *)member
{
if (!member)
{
return;
}
RoomMemberDetailsViewController *memberViewController = [RoomMemberDetailsViewController roomMemberDetailsViewController];
// Set delegate to handle action on member (start chat, mention)
memberViewController.delegate = self;
memberViewController.enableMention = (self.inputToolbarView != nil);
memberViewController.enableVoipCall = NO;
[memberViewController displayRoomMember:member withMatrixRoom:self.roomDataSource.room];
[self.navigationController pushViewController:memberViewController animated:YES];
}
#pragma mark - Hide/Show preview header
- (void)showPreviewHeader:(BOOL)isVisible
@ -2072,11 +2081,8 @@
if ([actionIdentifier isEqualToString:kMXKRoomBubbleCellTapOnAvatarView])
{
selectedRoomMember = [self.roomDataSource.roomState.members memberWithUserId:userInfo[kMXKRoomBubbleCellUserIdKey]];
if (selectedRoomMember)
{
[self performSegueWithIdentifier:@"showMemberDetails" sender:self];
}
MXRoomMember *member = [self.roomDataSource.roomState.members memberWithUserId:userInfo[kMXKRoomBubbleCellUserIdKey]];
[self showMemberDetails:member];
}
else if ([actionIdentifier isEqualToString:kMXKRoomBubbleCellLongPressOnAvatarView])
{
@ -2886,8 +2892,7 @@
if (member)
{
// Use the room member detail VC for room members
selectedRoomMember = member;
[self performSegueWithIdentifier:@"showMemberDetails" sender:self];
[self showMemberDetails:member];
}
else
{
@ -3138,74 +3143,7 @@
id pushedViewController = [segue destinationViewController];
if ([[segue identifier] isEqualToString:@"showRoomDetails"])
{
if ([pushedViewController isKindOfClass:[SegmentedViewController class]])
{
// Dismiss keyboard
[self dismissKeyboard];
SegmentedViewController* segmentedViewController = (SegmentedViewController*)pushedViewController;
MXSession* session = self.roomDataSource.mxSession;
NSString* roomId = self.roomDataSource.roomId;
NSMutableArray* viewControllers = [[NSMutableArray alloc] init];
NSMutableArray* titles = [[NSMutableArray alloc] init];
// members tab
[titles addObject: NSLocalizedStringFromTable(@"room_details_people", @"Vector", nil)];
RoomParticipantsViewController* participantsViewController = [RoomParticipantsViewController roomParticipantsViewController];
participantsViewController.delegate = self;
participantsViewController.enableMention = YES;
participantsViewController.mxRoom = [session roomWithRoomId:roomId];
[viewControllers addObject:participantsViewController];
// Files tab
[titles addObject: NSLocalizedStringFromTable(@"room_details_files", @"Vector", nil)];
RoomFilesViewController *roomFilesViewController = [RoomFilesViewController roomViewController];
// @TODO (async-state): This call should be synchronous. Every thing will be fine
__block MXKRoomDataSource *roomFilesDataSource;
[MXKRoomDataSource loadRoomDataSourceWithRoomId:roomId andMatrixSession:session onComplete:^(id roomDataSource) {
roomFilesDataSource = roomDataSource;
}];
roomFilesDataSource.filterMessagesWithURL = YES;
[roomFilesDataSource finalizeInitialization];
// Give the data source ownership to the room files view controller.
roomFilesViewController.hasRoomDataSourceOwnership = YES;
[roomFilesViewController displayRoom:roomFilesDataSource];
[viewControllers addObject:roomFilesViewController];
// Settings tab
[titles addObject: NSLocalizedStringFromTable(@"room_details_settings", @"Vector", nil)];
RoomSettingsViewController *settingsViewController = [RoomSettingsViewController roomSettingsViewController];
[settingsViewController initWithSession:session andRoomId:roomId];
[viewControllers addObject:settingsViewController];
// Sanity check
if (selectedRoomDetailsIndex > 2)
{
selectedRoomDetailsIndex = 0;
}
if (self.roomDataSource.room.isDirect)
{
segmentedViewController.title = NSLocalizedStringFromTable(@"room_details_title", @"Vector", nil);
}
else
{
segmentedViewController.title = NSLocalizedStringFromTable(@"room_details_title_for_dm", @"Vector", nil);
}
[segmentedViewController initWithTitles:titles viewControllers:viewControllers defaultSelected:selectedRoomDetailsIndex];
// Add the current session to be able to observe its state change.
[segmentedViewController addMatrixSession:session];
// Preselect the tapped field if any
settingsViewController.selectedRoomSettingsField = selectedRoomSettingsField;
selectedRoomSettingsField = RoomSettingsViewControllerFieldNone;
}
}
else if ([[segue identifier] isEqualToString:@"showRoomSearch"])
if ([[segue identifier] isEqualToString:@"showRoomSearch"])
{
// Dismiss keyboard
[self dismissKeyboard];
@ -3214,22 +3152,6 @@
// Add the current data source to be able to search messages.
roomSearchViewController.roomDataSource = self.roomDataSource;
}
else if ([[segue identifier] isEqualToString:@"showMemberDetails"])
{
if (selectedRoomMember)
{
RoomMemberDetailsViewController *memberViewController = pushedViewController;
// Set delegate to handle action on member (start chat, mention)
memberViewController.delegate = self;
memberViewController.enableMention = (self.inputToolbarView != nil);
memberViewController.enableVoipCall = NO;
[memberViewController displayRoomMember:selectedRoomMember withMatrixRoom:self.roomDataSource.room];
selectedRoomMember = nil;
}
}
else if ([[segue identifier] isEqualToString:@"showContactDetails"])
{
if (selectedContact)
@ -3251,39 +3173,6 @@
unknownDevices = nil;
}
}
else if ([[segue identifier] isEqualToString:@"showContactPicker"])
{
ContactsTableViewController *contactsPickerViewController = (ContactsTableViewController*)pushedViewController;
// Set delegate to handle selected contact
contactsPickerViewController.contactsTableViewControllerDelegate = self;
// Prepare its data source
ContactsDataSource *contactsDataSource = [[ContactsDataSource alloc] initWithMatrixSession:self.roomDataSource.mxSession];
contactsDataSource.areSectionsShrinkable = YES;
contactsDataSource.displaySearchInputInContactsList = YES;
contactsDataSource.forceMatrixIdInDisplayName = YES;
// Add a plus icon to the contact cell in the contacts picker, in order to make it more understandable for the end user.
contactsDataSource.contactCellAccessoryImage = [[UIImage imageNamed:@"plus_icon"] vc_tintedImageUsingColor:ThemeService.shared.theme.textPrimaryColor];
// List all the participants matrix user id to ignore them during the contacts search.
NSArray *members = [self.roomDataSource.roomState.members membersWithoutConferenceUser];
for (MXRoomMember *mxMember in members)
{
// Check his status
if (mxMember.membership == MXMembershipJoin || mxMember.membership == MXMembershipInvite)
{
// Create the contact related to this member
MXKContact *contact = [[MXKContact alloc] initMatrixContactWithDisplayName:mxMember.displayname andMatrixID:mxMember.userId];
contactsDataSource.ignoredContactsByMatrixId[mxMember.userId] = contact;
}
}
[contactsPickerViewController showSearch:YES];
contactsPickerViewController.searchBar.placeholder = NSLocalizedStringFromTable(@"room_participants_invite_another_user", @"Vector", nil);
[contactsPickerViewController displayList:contactsDataSource];
}
// Hide back button title
self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:nil action:nil];