Merged element 1.10.9 into bum

This commit is contained in:
Arnfried Griesert
2023-04-11 11:46:44 +02:00
73 changed files with 4351 additions and 979 deletions
+31 -7
View File
@@ -1109,7 +1109,8 @@ static CGSize kThreadListBarButtonItemImageSize;
_voiceMessageController.roomId = dataSource.roomId;
_userSuggestionCoordinator = [[UserSuggestionCoordinatorBridge alloc] initWithMediaManager:self.roomDataSource.mxSession.mediaManager
room:dataSource.room];
room:dataSource.room
userID:self.roomDataSource.mxSession.myUserId];
_userSuggestionCoordinator.delegate = self;
[self setupUserSuggestionViewIfNeeded];
@@ -5377,7 +5378,7 @@ static CGSize kThreadListBarButtonItemImageSize;
[self dismissKeyboard];
NSString *eventId = self.roomDataSource.room.accountData.readMarkerEventId;
NSString *threadId = self.roomDataSource.threadId;
[self reloadRoomWihtEventId:eventId threadId:threadId];
[self reloadRoomWihtEventId:eventId threadId:threadId forceUpdateRoomMarker:YES];
}
else if (sender == self.resetReadMarkerButton)
{
@@ -6676,8 +6677,12 @@ static CGSize kThreadListBarButtonItemImageSize;
// Check whether the read marker exists and has not been rendered yet.
if (self.roomDataSource.isLive && !self.roomDataSource.isPeeking && self.roomDataSource.showReadMarker && self.roomDataSource.room.accountData.readMarkerEventId)
{
UITableViewCell *cell = [self.bubblesTableView visibleCells].firstObject;
if ([cell isKindOfClass:MXKRoomBubbleTableViewCell.class] && ![cell isKindOfClass:MXKRoomEmptyBubbleTableViewCell.class])
NSPredicate *predicate = [NSPredicate predicateWithBlock:^BOOL(id evaluatedObject, NSDictionary *bindings) {
return [evaluatedObject isKindOfClass:MXKRoomBubbleTableViewCell.class];
}];
NSArray *visibleCells = [[self.bubblesTableView visibleCells] filteredArrayUsingPredicate:predicate];
UITableViewCell *cell = visibleCells.firstObject;
if (cell)
{
MXKRoomBubbleTableViewCell *roomBubbleTableViewCell = (MXKRoomBubbleTableViewCell*)cell;
// Check whether the read marker is inside the first displayed cell.
@@ -6704,6 +6709,9 @@ static CGSize kThreadListBarButtonItemImageSize;
else
{
self.jumpToLastUnreadBannerContainer.hidden = YES;
// Force the read marker position in order to not depend on the read marker animation (https://github.com/vector-im/element-ios/issues/7420)
self.updateRoomReadMarker = YES;
}
}
}
@@ -8000,15 +8008,17 @@ static CGSize kThreadListBarButtonItemImageSize;
[[AppDelegate theDelegate] showRoomWithParameters:parameters];
}
}
- (void)roomInfoCoordinatorBridgePresenter:(RoomInfoCoordinatorBridgePresenter *)coordinator
viewEventInTimeline:(MXEvent *)event
{
[self.navigationController popToViewController:self animated:true];
[self reloadRoomWihtEventId:event.eventId threadId:event.threadId];
[self reloadRoomWihtEventId:event.eventId threadId:event.threadId forceUpdateRoomMarker:NO];
}
-(void)reloadRoomWihtEventId:(NSString *)eventId
threadId:(NSString *)threadId
forceUpdateRoomMarker:(BOOL)forceUpdateRoomMarker
{
// Jump to the last unread event by using a temporary room data source initialized with the last unread event id.
MXWeakify(self);
@@ -8027,6 +8037,9 @@ static CGSize kThreadListBarButtonItemImageSize;
// Give the data source ownership to the room view controller.
self.hasRoomDataSourceOwnership = YES;
// Force the read marker update if needed (e.g if we jumped on the last unread message using the banner).
self.updateRoomReadMarker |= forceUpdateRoomMarker;
}];
}
@@ -8155,6 +8168,19 @@ static CGSize kThreadListBarButtonItemImageSize;
- (void)userSuggestionCoordinatorBridge:(UserSuggestionCoordinatorBridge *)coordinator
didRequestMentionForMember:(MXRoomMember *)member
textTrigger:(NSString *)textTrigger
{
[self removeTriggerTextFromComposer:textTrigger];
[self mention:member];
}
- (void)userSuggestionCoordinatorBridgeDidRequestMentionForRoom:(UserSuggestionCoordinatorBridge *)coordinator
textTrigger:(NSString *)textTrigger
{
[self removeTriggerTextFromComposer:textTrigger];
[self.inputToolbarView pasteText:[UserSuggestionID.room stringByAppendingString:@" "]];
}
- (void)removeTriggerTextFromComposer:(NSString *)textTrigger
{
RoomInputToolbarView *toolbar = (RoomInputToolbarView *)self.inputToolbarView;
if (toolbar && textTrigger.length) {
@@ -8165,8 +8191,6 @@ static CGSize kThreadListBarButtonItemImageSize;
range:NSMakeRange(0, attributedTextMessage.length)];
[toolbar setAttributedTextMessage:attributedTextMessage];
}
[self mention:member];
}
- (void)userSuggestionCoordinatorBridge:(UserSuggestionCoordinatorBridge *)coordinator didUpdateViewHeight:(CGFloat)height