mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-19 16:13:42 +02:00
Handle use only latest profile live refreshes
This commit is contained in:
committed by
aringenbach
parent
a6ed656107
commit
91d3411326
@@ -34,6 +34,8 @@
|
||||
#import "MXKSendReplyEventStringLocalizer.h"
|
||||
#import "MXKSlashCommands.h"
|
||||
|
||||
#import "GeneratedInterface-Swift.h"
|
||||
|
||||
const BOOL USE_THREAD_TIMELINE = YES;
|
||||
|
||||
#pragma mark - Constant definitions
|
||||
@@ -1009,6 +1011,11 @@ typedef NS_ENUM (NSUInteger, MXKRoomDataSourceError) {
|
||||
liveEventsListener = [_timeline listenToEventsOfTypes:liveEventTypesFilterForMessages onEvent:^(MXEvent *event, MXTimelineDirection direction, MXRoomState *roomState) {
|
||||
|
||||
MXStrongifyAndReturnIfNil(self);
|
||||
|
||||
if (RiotSettings.shared.roomScreenUseOnlyLatestProfiles && event.eventType == MXEventTypeRoomMember && event.isUserProfileChange)
|
||||
{
|
||||
[self refreshProfilesIfNeeded];
|
||||
}
|
||||
|
||||
if (MXTimelineDirectionForwards == direction)
|
||||
{
|
||||
@@ -4321,4 +4328,23 @@ typedef NS_ENUM (NSUInteger, MXKRoomDataSourceError) {
|
||||
self.secondaryRoomId = [self.mxSession virtualRoomOf:self.roomId];
|
||||
}
|
||||
|
||||
#pragma mark - Use Only Latest Profiles
|
||||
|
||||
/**
|
||||
Refreshes the avatars and display names if needed. This has no effect
|
||||
if `roomScreenUseOnlyLatestProfiles` is disabled.
|
||||
*/
|
||||
- (void)refreshProfilesIfNeeded
|
||||
{
|
||||
if (RiotSettings.shared.roomScreenUseOnlyLatestProfiles)
|
||||
{
|
||||
@synchronized (bubbles) {
|
||||
for (id<MXKRoomBubbleCellDataStoring> bubble in bubbles)
|
||||
{
|
||||
[bubble refreshProfileWithRoomDataSource:self];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user