Merge branch 'ismail/5068_design_tweaks' into ismail/5096_thread_notifications

This commit is contained in:
ismailgulek
2022-01-19 00:12:40 +03:00
102 changed files with 1607 additions and 771 deletions
@@ -50,7 +50,8 @@
The optional text pattern to be highlighted in the body of the message.
*/
NSString *highlightedPattern;
UIColor *highlightedPatternColor;
UIColor *highlightedPatternForegroundColor;
UIColor *highlightedPatternBackgroundColor;
UIFont *highlightedPatternFont;
}
@@ -351,10 +351,14 @@
return customAttributedTextMsg;
}
- (void)highlightPatternInTextMessage:(NSString*)pattern withForegroundColor:(UIColor*)patternColor andFont:(UIFont*)patternFont
- (void)highlightPatternInTextMessage:(NSString*)pattern
withBackgroundColor:(UIColor *)backgroundColor
foregroundColor:(UIColor*)foregroundColor
andFont:(UIFont*)patternFont
{
highlightedPattern = pattern;
highlightedPatternColor = patternColor;
highlightedPatternBackgroundColor = backgroundColor;
highlightedPatternForegroundColor = foregroundColor;
highlightedPatternFont = patternFont;
// Indicate that the text message layout should be recomputed.
@@ -889,10 +893,16 @@
while (range.location != NSNotFound)
{
if (highlightedPatternColor)
if (highlightedPatternBackgroundColor)
{
// Update background color
[customAttributedTextMsg addAttribute:NSBackgroundColorAttributeName value:highlightedPatternBackgroundColor range:range];
}
if (highlightedPatternForegroundColor)
{
// Update text color
[customAttributedTextMsg addAttribute:NSForegroundColorAttributeName value:highlightedPatternColor range:range];
[customAttributedTextMsg addAttribute:NSForegroundColorAttributeName value:highlightedPatternForegroundColor range:range];
}
if (highlightedPatternFont)
@@ -269,10 +269,14 @@ Update the event because its sent state changed or it is has been redacted.
Highlight all the occurrences of a pattern in the resulting message body 'attributedTextMessage'.
@param pattern the text pattern to highlight.
@param patternColor optional text color (the pattern text color is unchanged if nil).
@param backgroundColor optional text background color (the patterns background color is unchanged if nil)
@param foregroundColor optional text color (the pattern text color is unchanged if nil).
@param patternFont optional text font (the pattern font is unchanged if nil).
*/
- (void)highlightPatternInTextMessage:(NSString*)pattern withForegroundColor:(UIColor*)patternColor andFont:(UIFont*)patternFont;
- (void)highlightPatternInTextMessage:(NSString*)pattern
withBackgroundColor:(UIColor *)backgroundColor
foregroundColor:(UIColor*)foregroundColor
andFont:(UIFont*)patternFont;
/**
Refresh the sender flair information
@@ -2199,8 +2199,8 @@ typedef NS_ENUM (NSUInteger, MXKRoomDataSourceError) {
[self removeEventWithEventId:eventId];
if (event.isVoiceMessage) {
NSNumber *duration = event.content[kMXMessageContentKeyExtensibleAudio][kMXMessageContentKeyExtensibleAudioDuration];
NSArray<NSNumber *> *samples = event.content[kMXMessageContentKeyExtensibleAudio][kMXMessageContentKeyExtensibleAudioWaveform];
NSNumber *duration = event.content[kMXMessageContentKeyExtensibleAudioMSC1767][kMXMessageContentKeyExtensibleAudioDuration];
NSArray<NSNumber *> *samples = event.content[kMXMessageContentKeyExtensibleAudioMSC1767][kMXMessageContentKeyExtensibleAudioWaveform];
[self sendVoiceMessage:localFileURL mimeType:mimetype duration:duration.doubleValue samples:samples success:success failure:failure];
} else {