mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-19 08:03:50 +02:00
Observe URL preview update notification in RoomViewController.
Update bubbleTableView's content offset when a preview above the bottom most visible cell changes the height of the table's content.
This commit is contained in:
@@ -33,9 +33,6 @@ const CGFloat kTypingCellHeight = 24;
|
||||
{
|
||||
// Observe kThemeServiceDidChangeThemeNotification to handle user interface theme change.
|
||||
id kThemeServiceDidChangeThemeNotificationObserver;
|
||||
|
||||
// Observe URL preview updates to refresh cells.
|
||||
id kURLPreviewDidUpdateNotificationObserver;
|
||||
}
|
||||
|
||||
// Observe key verification request changes
|
||||
@@ -96,20 +93,6 @@ const CGFloat kTypingCellHeight = 24;
|
||||
|
||||
}];
|
||||
|
||||
// Observe URL preview updates.
|
||||
kURLPreviewDidUpdateNotificationObserver = [NSNotificationCenter.defaultCenter addObserverForName:URLPreviewDidUpdateNotification object:nil queue:NSOperationQueue.mainQueue usingBlock:^(NSNotification * _Nonnull notification) {
|
||||
|
||||
if (![(NSString*)notification.userInfo[@"roomId"] isEqualToString:self.roomId] || !self.delegate)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Refresh the updated cell.
|
||||
// Note - it doesn't appear as though MXKRoomViewController actually uses the index path.
|
||||
NSInteger index = [self indexOfCellDataWithEventId:(NSString*)notification.userInfo[@"eventId"]];
|
||||
[self.delegate dataSource:self didCellChange:[NSIndexPath indexPathWithIndex:index]];
|
||||
}];
|
||||
|
||||
[self registerKeyVerificationRequestNotification];
|
||||
[self registerKeyVerificationTransactionNotification];
|
||||
[self registerTrustLevelDidChangeNotifications];
|
||||
@@ -178,12 +161,6 @@ const CGFloat kTypingCellHeight = 24;
|
||||
kThemeServiceDidChangeThemeNotificationObserver = nil;
|
||||
}
|
||||
|
||||
if (kURLPreviewDidUpdateNotificationObserver)
|
||||
{
|
||||
[NSNotificationCenter.defaultCenter removeObserver:kURLPreviewDidUpdateNotificationObserver];
|
||||
kURLPreviewDidUpdateNotificationObserver = nil;
|
||||
}
|
||||
|
||||
if (self.keyVerificationRequestDidChangeNotificationObserver)
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self.keyVerificationRequestDidChangeNotificationObserver];
|
||||
|
||||
Reference in New Issue
Block a user