merged from element 1.8.13

This commit is contained in:
Arnfried Griesert
2022-05-05 06:57:45 +02:00
328 changed files with 11854 additions and 2365 deletions
@@ -66,6 +66,9 @@
*/
@property (nonatomic, nullable) NSString *highlightedEventId;
/// Is current user sharing is location in the room
@property(nonatomic, readonly) BOOL isCurrentUserSharingIsLocation;
/**
Check if there is an active jitsi widget in the room and return it.
@@ -132,4 +135,7 @@
- (void)roomDataSource:(RoomDataSource * _Nonnull)roomDataSource
didTapThread:(id<MXThreadProtocol> _Nonnull)thread;
/// Called when current live location sharing status is changing (start or stop location sharing in the room)
- (void)roomDataSourceDidUpdateCurrentUserSharingLocationStatus:(RoomDataSource * _Nonnull)roomDataSource;
@end
+40 -1
View File
@@ -57,6 +57,8 @@ const CGFloat kTypingCellHeight = 24;
@property (nonatomic) NSInteger typingCellIndex;
@property(nonatomic, readwrite) BOOL isCurrentUserSharingIsLocation;
@end
@implementation RoomDataSource
@@ -132,6 +134,8 @@ const CGFloat kTypingCellHeight = 24;
}
self.showTypingRow = YES;
[self updateCurrentUserLocationSharingStatus];
}
- (id<RoomDataSourceDelegate>)roomDataSourceDelegate
@@ -232,6 +236,11 @@ const CGFloat kTypingCellHeight = 24;
- (void)roomSummaryDidChange:(NSNotification*)notification
{
if (BuildSettings.liveLocationSharingEnabled)
{
[self updateCurrentUserLocationSharingStatus];
}
if (!self.room.summary.isEncrypted)
{
return;
@@ -1028,6 +1037,13 @@ const CGFloat kTypingCellHeight = 24;
// no need to reload when paginating back
return;
}
BOOL notify = YES;
if (self.threadId)
{
// no need to notify the thread screen, it'll cause a flickering
notify = NO;
}
NSUInteger count = 0;
@synchronized (bubbles)
{
@@ -1035,7 +1051,7 @@ const CGFloat kTypingCellHeight = 24;
}
if (count > 0)
{
[self reload];
[self reloadNotifying:notify];
}
}
@@ -1185,4 +1201,27 @@ const CGFloat kTypingCellHeight = 24;
didTapThread:summaryView.thread];
}
#pragma mark - Location sharing
- (void)updateCurrentUserLocationSharingStatus
{
MXLocationService *locationService = self.mxSession.locationService;
if (!locationService || !self.roomId)
{
return;
}
BOOL isUserSharingIsLocation = [locationService isCurrentUserSharingIsLocationInRoomWithId:self.roomId];
if (isUserSharingIsLocation != self.isCurrentUserSharingIsLocation)
{
self.isCurrentUserSharingIsLocation = [locationService isCurrentUserSharingIsLocationInRoomWithId:self.roomId];
dispatch_async(dispatch_get_main_queue(), ^{
[self.roomDataSourceDelegate roomDataSourceDidUpdateCurrentUserSharingLocationStatus:self];
});
}
}
@end
@@ -0,0 +1,46 @@
//
// 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
/// `RoomPreviewDataSource` is used for room context menu.
@objcMembers
public class RoomPreviewDataSource: RoomDataSource {
public override func finalizeInitialization() {
super.finalizeInitialization()
showReadMarker = false
showBubbleReceipts = false
showTypingRow = false
}
public override var showReadMarker: Bool {
get {
return false
} set {
_ = newValue
}
}
public override var showBubbleReceipts: Bool {
get {
return false
} set {
_ = newValue
}
}
}