Use thread protocols where possible

This commit is contained in:
ismailgulek
2022-02-11 18:11:44 +03:00
parent e223bc6533
commit c740a8110e
8 changed files with 30 additions and 16 deletions
@@ -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;
}