mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-21 09:02:44 +02:00
Merge remote-tracking branch 'origin/develop' into jitsi_widget
# Conflicts: # Riot.xcodeproj/project.pbxproj
This commit is contained in:
@@ -26,6 +26,14 @@
|
||||
|
||||
#import "MXRoom+Riot.h"
|
||||
|
||||
@interface RoomDataSource()
|
||||
{
|
||||
// Observe kRiotDesignValuesDidChangeThemeNotification to handle user interface theme change.
|
||||
id kRiotDesignValuesDidChangeThemeNotificationObserver;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation RoomDataSource
|
||||
|
||||
- (instancetype)initWithRoomId:(NSString *)roomId andMatrixSession:(MXSession *)matrixSession
|
||||
@@ -36,14 +44,8 @@
|
||||
// Replace default Cell data class
|
||||
[self registerCellDataClass:RoomBubbleCellData.class forCellIdentifier:kMXKRoomBubbleCellDataIdentifier];
|
||||
|
||||
// Replace event formatter
|
||||
self.eventFormatter = [[EventFormatter alloc] initWithMatrixSession:self.mxSession];
|
||||
self.eventFormatter.treatMatrixUserIdAsLink = YES;
|
||||
self.eventFormatter.treatMatrixRoomIdAsLink = YES;
|
||||
self.eventFormatter.treatMatrixRoomAliasAsLink = YES;
|
||||
|
||||
// Apply the event types filter to display only the wanted event types.
|
||||
self.eventFormatter.eventTypesFilterForMessages = [MXKAppSettings standardAppSettings].eventsFilterForMessages;
|
||||
// Replace the event formatter
|
||||
[self updateEventFormatter];
|
||||
|
||||
// Handle timestamp and read receips display at Vector app level (see [tableView: cellForRowAtIndexPath:])
|
||||
self.useCustomDateTimeLabel = YES;
|
||||
@@ -54,10 +56,43 @@
|
||||
self.bubblesPagination = MXKRoomDataSourceBubblesPaginationPerDay;
|
||||
|
||||
self.markTimelineInitialEvent = NO;
|
||||
|
||||
// Observe user interface theme change.
|
||||
kRiotDesignValuesDidChangeThemeNotificationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kRiotDesignValuesDidChangeThemeNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notif) {
|
||||
|
||||
// Force room data reload.
|
||||
[self updateEventFormatter];
|
||||
[self reload];
|
||||
|
||||
}];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)updateEventFormatter
|
||||
{
|
||||
// Set a new event formatter
|
||||
// TODO: We should use the same EventFormatter instance for all the rooms of a mxSession.
|
||||
self.eventFormatter = [[EventFormatter alloc] initWithMatrixSession:self.mxSession];
|
||||
self.eventFormatter.treatMatrixUserIdAsLink = YES;
|
||||
self.eventFormatter.treatMatrixRoomIdAsLink = YES;
|
||||
self.eventFormatter.treatMatrixRoomAliasAsLink = YES;
|
||||
|
||||
// Apply the event types filter to display only the wanted event types.
|
||||
self.eventFormatter.eventTypesFilterForMessages = [MXKAppSettings standardAppSettings].eventsFilterForMessages;
|
||||
}
|
||||
|
||||
- (void)destroy
|
||||
{
|
||||
if (kRiotDesignValuesDidChangeThemeNotificationObserver)
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:kRiotDesignValuesDidChangeThemeNotificationObserver];
|
||||
kRiotDesignValuesDidChangeThemeNotificationObserver = nil;
|
||||
}
|
||||
|
||||
[super destroy];
|
||||
}
|
||||
|
||||
- (void)didReceiveReceiptEvent:(MXEvent *)receiptEvent roomState:(MXRoomState *)roomState
|
||||
{
|
||||
// Override this callback to force rendering of each cell with read receipts information.
|
||||
|
||||
Reference in New Issue
Block a user