MXKRoomBubbleCellData: Improve getFirstBubbleComponentWithDisplay and getLastBubbleComponentWithDisplay.

This commit is contained in:
SBiOSoftWhare 2022-01-20 16:01:45 +01:00
parent 4b2e9bb8ac
commit 5ae11d1744

View file

@ -306,16 +306,15 @@
return first;
}
- (MXKRoomBubbleComponent*) getFirstBubbleComponentWithDisplay
- (MXKRoomBubbleComponent*)getFirstBubbleComponentWithDisplay
{
// Look for the first component which is actually displayed (some event are ignored in room history display).
MXKRoomBubbleComponent* first = nil;
@synchronized(bubbleComponents)
{
for (NSInteger index = 0; index < bubbleComponents.count; index++)
for (MXKRoomBubbleComponent *component in bubbleComponents)
{
MXKRoomBubbleComponent *component = bubbleComponents[index];
if (component.attributedTextMessage)
{
first = component;
@ -334,12 +333,12 @@
@synchronized(bubbleComponents)
{
for (NSInteger index = 0; index < bubbleComponents.count; index++)
for (MXKRoomBubbleComponent *component in bubbleComponents.reverseObjectEnumerator)
{
MXKRoomBubbleComponent *component = bubbleComponents[index];
if (component.attributedTextMessage)
{
lastVisibleComponent = component;
break;
}
}
}