Highlight thread root event in the timeline

This commit is contained in:
ismailgulek
2021-11-15 13:50:08 +03:00
parent 197aa409fd
commit 068db8eaaa
3 changed files with 53 additions and 4 deletions
@@ -55,6 +55,12 @@
*/
@property(nonatomic, nullable) NSArray<TypingUserInfo *> *currentTypingUsers;
/**
Identifier of the event to be highlighted. Default is nil.
Data source owner should reload the view itself to reflect changes, and nullify the parameter afterwards when it doesn't highlight the event anymore.
*/
@property (nonatomic, nullable) NSString *highlightedEventId;
/**
Check if there is an active jitsi widget in the room and return it.
@@ -774,14 +774,15 @@ const CGFloat kTypingCellHeight = 24;
}
// Manage initial event (case of permalink or search result)
if (self.timeline.initialEventId && self.markTimelineInitialEvent)
if ((self.timeline.initialEventId && self.markTimelineInitialEvent) || self.highlightedEventId)
{
// Check if the cell contains this initial event
for (NSUInteger index = 0; index < bubbleComponents.count; index++)
{
MXKRoomBubbleComponent *component = bubbleComponents[index];
if ([component.event.eventId isEqualToString:self.timeline.initialEventId])
if ([component.event.eventId isEqualToString:self.timeline.initialEventId]
|| [component.event.eventId isEqualToString:self.highlightedEventId])
{
// If yes, mark the event
[bubbleCell markComponent:index];