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
+56 -7
View File
@@ -42,6 +42,9 @@ const CGFloat kTypingCellHeight = 24;
// Observe key verification transaction changes
@property (nonatomic, weak) id keyVerificationTransactionDidChangeNotificationObserver;
// Listen to location beacon received
@property (nonatomic, weak) id beaconInfoSummaryListener;
// Timer used to debounce cells refresh
@property (nonatomic, strong) NSTimer *refreshCellsTimer;
@@ -57,7 +60,7 @@ const CGFloat kTypingCellHeight = 24;
@property (nonatomic) NSInteger typingCellIndex;
@property(nonatomic, readwrite) BOOL isCurrentUserSharingIsLocation;
@property(nonatomic, readwrite) BOOL isCurrentUserSharingActiveLocation;
@end
@@ -101,6 +104,7 @@ const CGFloat kTypingCellHeight = 24;
[self registerKeyVerificationRequestNotification];
[self registerKeyVerificationTransactionNotification];
[self registerTrustLevelDidChangeNotifications];
[self registerBeaconInfoSummaryListner];
self.encryptionTrustLevel = RoomEncryptionTrustLevelUnknown;
}
@@ -179,9 +183,14 @@ const CGFloat kTypingCellHeight = 24;
{
[[NSNotificationCenter defaultCenter] removeObserver:self.keyVerificationTransactionDidChangeNotificationObserver];
}
[self.mxSession.threadingService removeDelegate:self];
if (self.beaconInfoSummaryListener)
{
[self.mxSession.aggregations.beaconAggregations removeListener:self.beaconInfoSummaryListener];
}
[super destroy];
}
@@ -236,7 +245,7 @@ const CGFloat kTypingCellHeight = 24;
- (void)roomSummaryDidChange:(NSNotification*)notification
{
if (BuildSettings.liveLocationSharingEnabled)
if (RiotSettings.shared.enableLiveLocationSharing)
{
[self updateCurrentUserLocationSharingStatus];
}
@@ -808,6 +817,44 @@ const CGFloat kTypingCellHeight = 24;
}];
}
- (void)registerBeaconInfoSummaryListner
{
MXWeakify(self);
self.beaconInfoSummaryListener = [self.mxSession.aggregations.beaconAggregations listenToBeaconInfoSummaryUpdateInRoomWithId:self.roomId handler:^(id<MXBeaconInfoSummaryProtocol> beaconInfoSummary) {
MXStrongifyAndReturnIfNil(self);
[self updateCurrentUserLocationSharingStatus];
[self refreshFirstCellWithBeaconInfoSummary:beaconInfoSummary];
}];
}
- (void)refreshFirstCellWithBeaconInfoSummary:(id<MXBeaconInfoSummaryProtocol>)beaconInfoSummary
{
NSUInteger cellIndex;
__block RoomBubbleCellData *roomBubbleCellData;
@synchronized (bubbles)
{
cellIndex = [bubbles indexOfObjectPassingTest:^BOOL(id<MXKRoomBubbleCellDataStoring> _Nonnull cellData, NSUInteger idx, BOOL * _Nonnull stop) {
if ([cellData isKindOfClass:[RoomBubbleCellData class]])
{
roomBubbleCellData = (RoomBubbleCellData*)cellData;
if ([roomBubbleCellData.beaconInfoSummary.id isEqualToString:beaconInfoSummary.id])
{
*stop = YES;
return YES;
}
}
return NO;
}];
}
if (cellIndex != NSNotFound)
{
roomBubbleCellData.beaconInfoSummary = beaconInfoSummary;
[self refreshCells];
}
}
- (BOOL)shouldFetchKeyVerificationForEvent:(MXEvent*)event
{
if (!event)
@@ -1207,16 +1254,18 @@ const CGFloat kTypingCellHeight = 24;
{
MXLocationService *locationService = self.mxSession.locationService;
if (!locationService || !self.roomId)
NSString *roomId = self.roomId;
if (!locationService || !roomId)
{
return;
}
BOOL isUserSharingIsLocation = [locationService isCurrentUserSharingIsLocationInRoomWithId:self.roomId];
BOOL isUserSharingActiveLocation = [locationService isCurrentUserSharingActiveLocationInRoomWithId:roomId];
if (isUserSharingIsLocation != self.isCurrentUserSharingIsLocation)
if (isUserSharingActiveLocation != self.isCurrentUserSharingActiveLocation)
{
self.isCurrentUserSharingIsLocation = [locationService isCurrentUserSharingIsLocationInRoomWithId:self.roomId];
self.isCurrentUserSharingActiveLocation = isUserSharingActiveLocation;
dispatch_async(dispatch_get_main_queue(), ^{
[self.roomDataSourceDelegate roomDataSourceDidUpdateCurrentUserSharingLocationStatus:self];