MESSENGER-2762 Initial Merge

This commit is contained in:
Frank Rotermund
2022-03-17 15:51:23 +01:00
parent ecae8d618f
commit c2108a2178
384 changed files with 17708 additions and 1928 deletions
@@ -1,6 +1,7 @@
/*
Copyright 2015 OpenMarket Ltd
Copyright 2017 Vector Creations Ltd
Copyright (c) 2021 BWI GmbH
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -202,6 +203,12 @@ const CGFloat kTypingCellHeight = 24;
return kTypingCellHeight;
}
// bwi: Messages like avatar change may be filtered from the displayed timeline depending on settings
DefaultTimelineFilterService *service = [[DefaultTimelineFilterService alloc] init];
if ([service shouldFilter:[self cellDataAtIndex:index]]) {
return 0.0;
}
return [super cellHeightAtIndex:index withMaximumWidth:maxWidth];
}
@@ -241,6 +248,40 @@ const CGFloat kTypingCellHeight = 24;
[self.roomDataSourceDelegate roomDataSourceDidUpdateEncryptionTrustLevel:self];
}
- (NSArray *)attachmentsWithThumbnail
{
NSMutableArray *attachments = [NSMutableArray array];
@synchronized(bubbles)
{
for (id<MXKRoomBubbleCellDataStoring> bubbleData in bubbles)
{
if (bubbleData.isAttachmentWithThumbnail && bubbleData.attachment.type != MXKAttachmentTypeSticker)
{
if (BuildSettings.enableAntivirusScan)
{
MXKRoomBubbleCellData *roomBubbleCellData;
if ([bubbleData isKindOfClass:MXKRoomBubbleCellData.class])
{
roomBubbleCellData = (MXKRoomBubbleCellData*)bubbleData;
}
// Append attchment only if the scan status is trusted
if (bubbleData.showAntivirusScanStatus && roomBubbleCellData.eventScanForFirstComponent && roomBubbleCellData.eventScanForFirstComponent.antivirusScanStatus != MXAntivirusScanStatusTrusted)
{
continue;
}
}
[attachments addObject:bubbleData.attachment];
}
}
}
return attachments;
}
- (void)roomDidSet
{
[self enableRoomCreationIntroCellDisplayIfNeeded];
@@ -389,6 +430,20 @@ const CGFloat kTypingCellHeight = 24;
BOOL isCollapsableCellCollapsed = cellData.collapsable && cellData.collapsed;
if (BuildSettings.enableLastMessageTimestamp) {
// Display timestamp of the last message
if (cellData.containsLastMessage && !isCollapsableCellCollapsed)
{
[bubbleCell addTimestampLabelForComponent:cellData.mostRecentComponentIndex];
}
} else {
// Display timestamp of every message
if (!isCollapsableCellCollapsed)
{
[bubbleCell addTimestampLabelForComponent:cellData.mostRecentComponentIndex];
}
}
// Display timestamp of the message if needed
[cellDecorator addTimestampLabelIfNeededToCell:bubbleCell cellData:cellData];