Use only latest profiles in the timeline (labs)

This commit is contained in:
Arnaud Ringenbach
2022-03-02 11:12:44 +01:00
committed by aringenbach
parent d9a6c4d8f2
commit a6ed656107
8 changed files with 47 additions and 6 deletions
@@ -16,6 +16,8 @@
#import "MXKRoomBubbleCellDataWithAppendingMode.h"
#import "GeneratedInterface-Swift.h"
static NSAttributedString *messageSeparator = nil;
@implementation MXKRoomBubbleCellDataWithAppendingMode
@@ -46,8 +48,9 @@ static NSAttributedString *messageSeparator = nil;
}
// Check sender information
NSString *eventSenderName = [roomDataSource.eventFormatter senderDisplayNameForEvent:event withRoomState:roomState];
NSString *eventSenderAvatar = [roomDataSource.eventFormatter senderAvatarUrlForEvent:event withRoomState:roomState];
MXRoomState *profileRoomState = RiotSettings.shared.roomScreenUseOnlyLatestProfiles ? roomDataSource.roomState : roomState;
NSString *eventSenderName = [roomDataSource.eventFormatter senderDisplayNameForEvent:event withRoomState:profileRoomState];
NSString *eventSenderAvatar = [roomDataSource.eventFormatter senderAvatarUrlForEvent:event withRoomState:profileRoomState];
if ((self.senderDisplayName || eventSenderName) &&
([self.senderDisplayName isEqualToString:eventSenderName] == NO))
{