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
@@ -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
{