EventFormatter: add showEditionMention setting

This commit is contained in:
manuroe 2019-07-01 12:42:42 +02:00
parent 26a8a6fd8d
commit 4c7a652fd9
3 changed files with 10 additions and 3 deletions

View file

@ -102,8 +102,8 @@ final class EditHistoryCoordinatorBridgePresenter: NSObject {
formatter.treatMatrixGroupIdAsLink = true
formatter.eventTypesFilterForMessages = MXKAppSettings.standard()?.eventsFilterForMessages
// But do not display "...(edited)"
// TODO
// But do not display "...(Edited)"
formatter.showEditionMention = false
return formatter
}

View file

@ -36,6 +36,12 @@ FOUNDATION_EXPORT NSString *const EventFormatterEditedEventLinkAction;
*/
@interface EventFormatter : MXKEventFormatter
/**
Add a "(Edited)" mention to edited message.
Default is YES.
*/
@property (nonatomic) BOOL showEditionMention;
/**
Text color used to display message edited mention.
Default is `textSecondaryColor`.

View file

@ -182,7 +182,7 @@ static NSString *const kEventFormatterTimeFormat = @"HH:mm";
attributedString = attributedStringWithRerequestMessage;
}
}
else if (event.contentHasBeenEdited)
else if (self.showEditionMention && event.contentHasBeenEdited)
{
NSMutableAttributedString *attributedStringWithEditMention = [attributedString mutableCopy];
@ -255,6 +255,7 @@ static NSString *const kEventFormatterTimeFormat = @"HH:mm";
self.encryptingTextColor = ThemeService.shared.theme.tintColor;
self.sendingTextColor = ThemeService.shared.theme.textSecondaryColor;
self.errorTextColor = ThemeService.shared.theme.warningColor;
self.showEditionMention = YES;
self.editionMentionTextColor = ThemeService.shared.theme.textSecondaryColor;
self.defaultTextFont = [UIFont systemFontOfSize:15];