merged element-ios 1.10.5 into 4409_basis_update_1_10_5

This commit is contained in:
Arnfried Griesert
2023-03-16 12:19:26 +01:00
168 changed files with 2451 additions and 850 deletions
@@ -508,7 +508,7 @@ static const CGFloat kLocalPreviewMargin = 20;
}
else if (mxCall.isConferenceCall)
{
peerDisplayName = mxCall.room.summary.displayname;
peerDisplayName = mxCall.room.summary.displayName;
peerAvatarURL = mxCall.room.summary.avatar;
}
@@ -954,9 +954,10 @@ static NSArray<NSNumber*> *initialSyncSilentErrorsHTTPStatusCodes;
if (clearStore)
{
// Force a reload of device keys at the next session start.
// Force a reload of device keys at the next session start, unless we are just about to migrate
// all data and device keys into CryptoSDK.
// This will fix potential UISIs other peoples receive for our messages.
if ([mxSession.crypto isKindOfClass:[MXLegacyCrypto class]])
if ([mxSession.crypto isKindOfClass:[MXLegacyCrypto class]] && !MXSDKOptions.sharedInstance.enableCryptoSDK)
{
[(MXLegacyCrypto *)mxSession.crypto resetDeviceKeys];
}
@@ -199,7 +199,9 @@ static NSString *const kMXAppGroupID = @"group.org.matrix";
kMXEventTypeStringCallHangup,
kMXEventTypeStringSticker,
kMXEventTypeStringPollStart,
kMXEventTypeStringPollStartMSC3381
kMXEventTypeStringPollStartMSC3381,
kMXEventTypeStringPollEnd,
kMXEventTypeStringPollEndMSC3381
].mutableCopy;
_messageDetailsAllowSharing = YES;
@@ -26,10 +26,21 @@
*/
NSMutableDictionary *roomDataSources;
/**
The list of rooms with a "late decryption" event. Causing bubbles issues
Each element is a room ID.
*/
NSMutableSet *roomDataSourcesToDestroy;
/**
Observe UIApplicationDidReceiveMemoryWarningNotification to dispose of any resources that can be recreated.
*/
id UIApplicationDidReceiveMemoryWarningNotificationObserver;
/**
Observe kMXEventDidDecryptNotification to get late decrypted events.
*/
id mxEventDidDecryptNotificationObserver;
}
@end
@@ -119,6 +130,7 @@ static Class _roomDataSourceClass;
{
mxSession = matrixSession;
roomDataSources = [NSMutableDictionary dictionary];
roomDataSourcesToDestroy = [NSMutableSet set];
_releasePolicy = MXKRoomDataSourceManagerReleasePolicyNeverRelease;
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didMXSessionDidLeaveRoom:) name:kMXSessionDidLeaveRoomNotification object:nil];
@@ -138,6 +150,12 @@ static Class _roomDataSourceClass;
}
}];
// Observe late decrypted events, and store rooms ids in memory
mxEventDidDecryptNotificationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kMXEventDidDecryptNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notif) {
MXEvent *decryptedEvent = notif.object;
[self->roomDataSourcesToDestroy addObject:decryptedEvent.roomId];
}];
}
return self;
}
@@ -156,6 +174,11 @@ static Class _roomDataSourceClass;
[[NSNotificationCenter defaultCenter] removeObserver:UIApplicationDidReceiveMemoryWarningNotificationObserver];
UIApplicationDidReceiveMemoryWarningNotificationObserver = nil;
}
if (mxEventDidDecryptNotificationObserver)
{
[[NSNotificationCenter defaultCenter] removeObserver:mxEventDidDecryptNotificationObserver];
mxEventDidDecryptNotificationObserver = nil;
}
}
#pragma mark
@@ -202,9 +225,19 @@ static Class _roomDataSourceClass;
// If not available yet, create the room data source
MXKRoomDataSource *roomDataSource = roomDataSources[roomId];
// check if the room's dataSource has events with late decryption issues and destroys it
BOOL roomDataSourceToBeDestroyed = [roomDataSourcesToDestroy containsObject:roomId];
if (roomDataSource && roomDataSourceToBeDestroyed && create) {
[roomDataSource destroy];
roomDataSources[roomId] = nil;
roomDataSource = nil;
}
if (!roomDataSource && create && roomId)
{
[roomDataSourcesToDestroy removeObject:roomId];
[_roomDataSourceClass loadRoomDataSourceWithRoomId:roomId threadId:nil andMatrixSession:mxSession onComplete:^(id roomDataSource) {
[self addRoomDataSource:roomDataSource];
onComplete(roomDataSource);
@@ -49,7 +49,7 @@ class MXKSendReplyEventStringLocalizer: NSObject, MXSendReplyEventStringLocalize
VectorL10n.messageReplyToMessageToReplyToPrefix
}
func replyToEndedPoll() -> String {
func endedPollMessage() -> String {
VectorL10n.pollTimelineReplyEndedPoll
}
}
@@ -86,7 +86,7 @@
{
return self.roomSummary.spaceChildInfo.displayName;
}
return roomSummary.displayname;
return roomSummary.displayName;
}
- (NSString *)avatarUrl
@@ -45,7 +45,7 @@
MXRoom *room = [searchDataSource.mxSession roomWithRoomId:searchResult.result.roomId];
if (room)
{
title = room.summary.displayname;
title = room.summary.displayName;
}
else
{
@@ -1900,7 +1900,7 @@ static NSString *const kRepliedTextPattern = @"<mx-reply>.*<blockquote>.*<br>(.*
repliedEventContent = [MXEventContentPollStart modelFromJSON:repliedEvent.content].question;
}
if (!repliedEventContent && repliedEvent.eventType == MXEventTypePollEnd) {
repliedEventContent = MXSendReplyEventDefaultStringLocalizer.new.replyToEndedPoll;
repliedEventContent = MXSendReplyEventDefaultStringLocalizer.new.endedPollMessage;
}
}
@@ -169,7 +169,7 @@
if ((row >= 0) && (row < rooms.count))
{
MXRoom* room = [rooms objectAtIndex:row];
_inputTextField.text = room.summary.displayname;
_inputTextField.text = room.summary.displayName;
_addButton.enabled = YES;
}
@@ -191,7 +191,7 @@
rooms = [_mxSession.rooms sortedArrayUsingComparator:^NSComparisonResult(MXRoom* firstRoom, MXRoom* secondRoom) {
// Alphabetic order
return [firstRoom.summary.displayname compare:secondRoom.summary.displayname options:NSCaseInsensitiveSearch];
return [firstRoom.summary.displayName compare:secondRoom.summary.displayName options:NSCaseInsensitiveSearch];
}];
return rooms.count;
@@ -202,7 +202,7 @@
- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component
{
MXRoom* room = [rooms objectAtIndex:row];
return room.summary.displayname;
return room.summary.displayName;
}
@end
@@ -71,7 +71,7 @@
MXRoom *room = [_mxSession roomWithRoomId:mxPushRule.ruleId];
if (room)
{
description = [VectorL10n notificationSettingsRoomRuleTitle:room.summary.displayname];
description = [VectorL10n notificationSettingsRoomRuleTitle:room.summary.displayName];
}
break;
}
@@ -82,7 +82,7 @@
if (_mxRoom)
{
// Replace empty string by nil : avoid having the placeholder 'Room name" when there is no displayname
self.displayNameTextField.text = (_mxRoom.summary.displayname.length) ? _mxRoom.summary.displayname : nil;
self.displayNameTextField.text = (_mxRoom.summary.displayName.length) ? _mxRoom.summary.displayName : nil;
}
else if (_mxUser)
{
@@ -189,7 +189,7 @@
if (userPowerLevel >= [powerLevels minimumPowerLevelForSendingEventAsStateEvent:kMXEventTypeStringRoomName])
{
// Only the room name is edited here, update the text field with the room name
textField.text = _mxRoom.summary.displayname;
textField.text = _mxRoom.summary.displayName;
textField.backgroundColor = [UIColor whiteColor];
}
else
@@ -236,7 +236,7 @@
textField.backgroundColor = [UIColor clearColor];
NSString *roomName = textField.text;
if ((roomName.length || _mxRoom.summary.displayname.length) && [roomName isEqualToString:_mxRoom.summary.displayname] == NO)
if ((roomName.length || _mxRoom.summary.displayName.length) && [roomName isEqualToString:_mxRoom.summary.displayName] == NO)
{
if ([self.delegate respondsToSelector:@selector(roomTitleView:isSaving:)])
{
@@ -266,7 +266,7 @@
}
// Revert change
textField.text = strongSelf.mxRoom.summary.displayname;
textField.text = strongSelf.mxRoom.summary.displayName;
MXLogDebug(@"[MXKRoomTitleView] Rename room failed");
// Notify MatrixKit user
NSString *myUserId = strongSelf.mxRoom.mxSession.myUser.userId;
@@ -278,7 +278,7 @@
else
{
// No change on room name, restore title with room displayName
textField.text = _mxRoom.summary.displayname;
textField.text = _mxRoom.summary.displayName;
}
}
}
@@ -367,7 +367,7 @@
if (userPowerLevel >= [powerLevels minimumPowerLevelForSendingEventAsStateEvent:kMXEventTypeStringRoomName])
{
// Only the room name is edited here, update the text field with the room name
textField.text = self.mxRoom.summary.displayname;
textField.text = self.mxRoom.summary.displayName;
textField.backgroundColor = [UIColor whiteColor];
}
else