mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-28 23:32:41 +00:00
EventFormatter: add showEditionMention setting
This commit is contained in:
parent
26a8a6fd8d
commit
4c7a652fd9
3 changed files with 10 additions and 3 deletions
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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`.
|
||||
|
|
|
@ -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];
|
||||
|
|
Loading…
Reference in a new issue