Merge branch 'master' of https://github.com/vector-im/element-ios into feature/3269_merge_element_1_8_18

# Conflicts:
#	Config/AppIdentifiers.xcconfig
#	Config/AppVersion.xcconfig
#	Podfile
#	Podfile.lock
#	Riot/Assets/de.lproj/Vector.strings
#	Riot/Generated/Images.swift
#	Riot/Modules/Analytics/DecryptionFailureTracker.m
#	Riot/Modules/Application/LegacyAppDelegate.h
#	Riot/Modules/Onboarding/OnboardingCoordinator.swift
#	Riot/Modules/Room/RoomInfo/RoomInfoList/RoomInfoListViewController.swift
#	Riot/Modules/Room/RoomViewController.m
#	Riot/SupportingFiles/Info.plist
#	Riot/Utils/EventFormatter.m
#	Riot/Utils/Tools.h
#	Riot/Utils/Tools.m
#	Riot/target.yml
#	RiotSwiftUI/Modules/Common/Mock/MockAppScreens.swift
#	fastlane/Fastfile
#	project.yml
This commit is contained in:
Frank Rotermund
2022-06-12 19:49:46 +02:00
533 changed files with 25776 additions and 3058 deletions
@@ -175,7 +175,7 @@ typedef BOOL (^MXKAccountOnCertificateChange)(MXKAccount *mxAccount, NSData *cer
@param credentials user's credentials
*/
- (instancetype)initWithCredentials:(MXCredentials*)credentials;
- (nonnull instancetype)initWithCredentials:(MXCredentials*)credentials;
/**
Create a matrix session based on the provided store.
@@ -135,7 +135,7 @@ static NSArray<NSNumber*> *initialSyncSilentErrorsHTTPStatusCodes;
}
}
- (instancetype)initWithCredentials:(MXCredentials*)credentials
- (nonnull instancetype)initWithCredentials:(MXCredentials*)credentials
{
if (self = [super init])
{
@@ -147,7 +147,9 @@ static NSString *const kMXAppGroupID = @"group.org.matrix";
kMXEventTypeStringKeyVerificationCancel,
kMXEventTypeStringKeyVerificationDone,
kMXEventTypeStringPollStart,
kMXEventTypeStringPollStartMSC3381
kMXEventTypeStringPollStartMSC3381,
kMXEventTypeStringBeaconInfo,
kMXEventTypeStringBeaconInfoMSC3672
].mutableCopy;
@@ -179,7 +181,9 @@ static NSString *const kMXAppGroupID = @"group.org.matrix";
kMXEventTypeStringKeyVerificationCancel,
kMXEventTypeStringKeyVerificationDone,
kMXEventTypeStringPollStart,
kMXEventTypeStringPollStartMSC3381
kMXEventTypeStringPollStartMSC3381,
kMXEventTypeStringBeaconInfo,
kMXEventTypeStringBeaconInfoMSC3672
].mutableCopy;
lastMessageEventTypesAllowList = @[
@@ -538,7 +538,7 @@
// Select the right text view for measurement
UITextView *selectedTextView = (removeVerticalInset ? measurementTextViewWithoutInset : measurementTextView);
selectedTextView.frame = CGRectMake(0, 0, _maxTextViewWidth, MAXFLOAT);
selectedTextView.frame = CGRectMake(0, 0, _maxTextViewWidth, 0);
selectedTextView.attributedText = attributedText;
CGSize size = [selectedTextView sizeThatFits:selectedTextView.frame.size];
@@ -170,6 +170,11 @@ extern NSString *const kMXKRoomDataSourceTimelineErrorErrorKey;
*/
@property (nonatomic) NSString *partialTextMessage;
/**
The current attributed text message partially typed in text input (use nil to reset it).
*/
@property (nonatomic) NSAttributedString *partialAttributedTextMessage;
/**
The current thread id for the data source. If provided, data source displays the specified thread, otherwise the whole room messages.
*/
@@ -471,6 +476,14 @@ extern NSString *const kMXKRoomDataSourceTimelineErrorErrorKey;
success:(void (^)(NSString *))success
failure:(void (^)(NSError *))failure;
/**
Updates an event with replacement event.
@note the original event is defined in the `MXEventContentRelatesTo` object.
@param replaceEvent the new event to display
*/
- (void)updateEventWithReplaceEvent:(MXEvent*)replaceEvent;
/**
Indicates if replying to the provided event is supported.
Only event of type 'MXEventTypeRoomMessage' are supported for the moment, and for certain msgtype.
@@ -735,6 +748,25 @@ extern NSString *const kMXKRoomDataSourceTimelineErrorErrorKey;
roomState:(MXRoomState*)roomState
direction:(MXTimelineDirection)direction;
/**
Queue an event in order to process its display later.
@param event the event to process.
@param roomState the state of the room when the event fired.
@param direction the order of the events in the arrays
*/
- (void)queueEventForProcessing:(MXEvent*)event
withRoomState:(MXRoomState*)roomState
direction:(MXTimelineDirection)direction;
/**
Start processing pending events.
@param onComplete a block called (on the main thread) when the processing has been done. Can be nil.
Note this block returns the number of added cells in first and last positions.
*/
- (void)processQueuedEvents:(void (^)(NSUInteger addedHistoryCellNb, NSUInteger addedLiveCellNb))onComplete;
#pragma mark - Bubble collapsing
/**
@@ -31,7 +31,6 @@
#import "MXKAppSettings.h"
#import "MXKSendReplyEventStringLocalizer.h"
#import "MXKSlashCommands.h"
#import "GeneratedInterface-Swift.h"
@@ -991,6 +990,16 @@ typedef NS_ENUM (NSUInteger, MXKRoomDataSourceError) {
_room.partialTextMessage = partialTextMessage;
}
- (NSAttributedString *)partialAttributedTextMessage
{
return _room.partialAttributedTextMessage;
}
- (void)setPartialAttributedTextMessage:(NSAttributedString *)partialAttributedTextMessage
{
_room.partialAttributedTextMessage = partialAttributedTextMessage;
}
- (void)refreshEventListeners:(NSArray *)liveEventTypesFilterForMessages
{
// Remove the existing listeners
@@ -2982,13 +2991,6 @@ typedef NS_ENUM (NSUInteger, MXKRoomDataSourceError) {
return processingQueue;
}
/**
Queue an event in order to process its display later.
@param event the event to process.
@param roomState the state of the room when the event fired.
@param direction the order of the events in the arrays
*/
- (void)queueEventForProcessing:(MXEvent*)event withRoomState:(MXRoomState*)roomState direction:(MXTimelineDirection)direction
{
if (event.isLocalEvent)
@@ -3166,12 +3168,6 @@ typedef NS_ENUM (NSUInteger, MXKRoomDataSourceError) {
return isHighlighted;
}
/**
Start processing pending events.
@param onComplete a block called (on the main thread) when the processing has been done. Can be nil.
Note this block returns the number of added cells in first and last positions.
*/
- (void)processQueuedEvents:(void (^)(NSUInteger addedHistoryCellNb, NSUInteger addedLiveCellNb))onComplete
{
MXWeakify(self);
@@ -1,25 +0,0 @@
/*
Copyright 2018 New Vector Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#import <Foundation/Foundation.h>
#import <MatrixSDK/MXSendReplyEventStringLocalizerProtocol.h>
/**
A `MXKSendReplyEventStringLocalizer` instance represents string localizations used when send reply event to a message in a room.
*/
@interface MXKSendReplyEventStringLocalizer : NSObject<MXSendReplyEventStringLocalizerProtocol>
@end
@@ -1,58 +0,0 @@
/*
Copyright 2018 New Vector Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#import "MXKSendReplyEventStringLocalizer.h"
#import "MXKSwiftHeader.h"
@implementation MXKSendReplyEventStringLocalizer
- (NSString *)senderSentAnImage
{
return [VectorL10n messageReplyToSenderSentAnImage];
}
- (NSString *)senderSentAVideo
{
return [VectorL10n messageReplyToSenderSentAVideo];
}
- (NSString *)senderSentAnAudioFile
{
return [VectorL10n messageReplyToSenderSentAnAudioFile];
}
- (NSString *)senderSentAVoiceMessage
{
return [VectorL10n messageReplyToSenderSentAVoiceMessage];
}
- (NSString *)senderSentAFile
{
return [VectorL10n messageReplyToSenderSentAFile];
}
- (NSString *)senderSentTheirLocation
{
return [VectorL10n messageReplyToSenderSentTheirLocation];
}
- (NSString *)messageToReplyToPrefix
{
return [VectorL10n messageReplyToMessageToReplyToPrefix];
}
@end
@@ -0,0 +1,47 @@
//
// Copyright 2022 New Vector Ltd
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
import Foundation
class MXKSendReplyEventStringLocalizer: NSObject, MXSendReplyEventStringLocalizerProtocol {
func senderSentAnImage() -> String {
return VectorL10n.messageReplyToSenderSentAnImage
}
func senderSentAVideo() -> String {
return VectorL10n.messageReplyToSenderSentAVideo
}
func senderSentAnAudioFile() -> String {
return VectorL10n.messageReplyToSenderSentAnAudioFile
}
func senderSentAVoiceMessage() -> String {
return VectorL10n.messageReplyToSenderSentAVoiceMessage
}
func senderSentAFile() -> String {
return VectorL10n.messageReplyToSenderSentAFile
}
func senderSentTheirLocation() -> String {
return VectorL10n.messageReplyToSenderSentTheirLocation
}
func messageToReplyToPrefix() -> String {
return VectorL10n.messageReplyToMessageToReplyToPrefix
}
}
@@ -93,6 +93,11 @@
return roomSummary.avatar;
}
- (NSString *)directUserId
{
return self.roomSummary.directUserId;
}
- (MXPresence)presence
{
if (self.roomSummary.isDirect)
@@ -44,6 +44,7 @@
@property (nonatomic, readonly) NSString *roomIdentifier;
@property (nonatomic, readonly) NSString *roomDisplayname;
@property (nonatomic, readonly) NSString *avatarUrl;
@property (nonatomic, readonly) NSString *directUserId;
@property (nonatomic, readonly) MXPresence presence;
@property (nonatomic, readonly) NSString *lastEventTextMessage;
@property (nonatomic, readonly) NSString *lastEventDate;