Rename profile as userAvatarAndName

This commit is contained in:
Arnaud Ringenbach
2022-03-04 15:48:59 +01:00
committed by aringenbach
parent fb95e6fd78
commit cfeae5bc64
8 changed files with 30 additions and 24 deletions
@@ -58,8 +58,11 @@
targetId = [event.type isEqualToString:kMXEventTypeStringRoomMember] ? event.stateKey : nil;
roomId = roomDataSource.roomId;
MXRoomState *profileRoomState = RiotSettings.shared.roomScreenUseOnlyLatestProfiles ? roomDataSource.roomState : roomState;
[self setRoomState:profileRoomState];
// If `roomScreenUseOnlyLatestUserAvatarAndName`is enabled, the avatar and name are
// displayed from the latest room state perspective rather than the historical.
MXRoomState *latestRoomState = roomDataSource.roomState;
MXRoomState *displayRoomState = RiotSettings.shared.roomScreenUseOnlyLatestUserAvatarAndName ? latestRoomState : roomState;
[self setRoomState:displayRoomState];
senderAvatarPlaceholder = nil;
targetAvatarPlaceholder = nil;
@@ -48,9 +48,12 @@ static NSAttributedString *messageSeparator = nil;
}
// Check sender information
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 `roomScreenUseOnlyLatestUserAvatarAndName`is enabled, the avatar and name are
// displayed from the latest room state perspective rather than the historical.
MXRoomState *latestRoomState = roomDataSource.roomState;
MXRoomState *displayRoomState = RiotSettings.shared.roomScreenUseOnlyLatestUserAvatarAndName ? latestRoomState : roomState;
NSString *eventSenderName = [roomDataSource.eventFormatter senderDisplayNameForEvent:event withRoomState:displayRoomState];
NSString *eventSenderAvatar = [roomDataSource.eventFormatter senderAvatarUrlForEvent:event withRoomState:displayRoomState];
if ((self.senderDisplayName || eventSenderName) &&
([self.senderDisplayName isEqualToString:eventSenderName] == NO))
{
@@ -4332,11 +4332,11 @@ typedef NS_ENUM (NSUInteger, MXKRoomDataSourceError) {
/**
Refreshes the avatars and display names if needed. This has no effect
if `roomScreenUseOnlyLatestProfiles` is disabled.
if `roomScreenUseOnlyLatestUserAvatarAndName` is disabled.
*/
- (void)refreshProfilesIfNeeded
{
if (RiotSettings.shared.roomScreenUseOnlyLatestProfiles)
if (RiotSettings.shared.roomScreenUseOnlyLatestUserAvatarAndName)
{
@synchronized (bubbles) {
for (id<MXKRoomBubbleCellDataStoring> bubble in bubbles)