mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-19 08:03:50 +02:00
Use thread protocols where possible
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
#import "MXKEventFormatter.h"
|
||||
#import "MXKURLPreviewDataProtocol.h"
|
||||
|
||||
@class MXThread;
|
||||
@protocol MXThreadProtocol;
|
||||
|
||||
/**
|
||||
Flags to indicate if a fix is required at the display time.
|
||||
@@ -108,7 +108,7 @@ typedef enum : NSUInteger {
|
||||
/**
|
||||
Thread for the bubble component. Should only exist for thread root events.
|
||||
*/
|
||||
@property (nonatomic, readonly) MXThread *thread;
|
||||
@property (nonatomic, readonly) id<MXThreadProtocol> thread;
|
||||
|
||||
/**
|
||||
Create a new `MXKRoomBubbleComponent` object based on a `MXEvent` instance.
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
@interface MXKRoomBubbleComponent ()
|
||||
|
||||
@property (nonatomic, readwrite) MXThread *thread;
|
||||
@property (nonatomic, readwrite) id<MXThreadProtocol> thread;
|
||||
|
||||
@end
|
||||
|
||||
@@ -69,8 +69,17 @@
|
||||
_showEncryptionBadge = [self shouldShowWarningBadgeForEvent:event roomState:(MXRoomState*)roomState session:session];
|
||||
|
||||
[self updateLinkWithRoomState:roomState];
|
||||
|
||||
self.thread = [session.threadingService threadWithId:event.eventId];
|
||||
|
||||
if (event.unsignedData.relations.thread)
|
||||
{
|
||||
self.thread = [[MXThreadModel alloc] initWithRootEvent:event
|
||||
notificationCount:0
|
||||
highlightCount:0];
|
||||
}
|
||||
else
|
||||
{
|
||||
self.thread = [session.threadingService threadWithId:event.eventId];
|
||||
}
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user