mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-21 17:12:45 +02:00
Merge branch 'master' of https://github.com/vector-im/element-ios into feature/3269_merge_element_1_8_18
# Conflicts: # Config/AppIdentifiers.xcconfig # Config/AppVersion.xcconfig # Podfile # Podfile.lock # Riot/Assets/de.lproj/Vector.strings # Riot/Generated/Images.swift # Riot/Modules/Analytics/DecryptionFailureTracker.m # Riot/Modules/Application/LegacyAppDelegate.h # Riot/Modules/Onboarding/OnboardingCoordinator.swift # Riot/Modules/Room/RoomInfo/RoomInfoList/RoomInfoListViewController.swift # Riot/Modules/Room/RoomViewController.m # Riot/SupportingFiles/Info.plist # Riot/Utils/EventFormatter.m # Riot/Utils/Tools.h # Riot/Utils/Tools.m # Riot/target.yml # RiotSwiftUI/Modules/Common/Mock/MockAppScreens.swift # fastlane/Fastfile # project.yml
This commit is contained in:
@@ -228,6 +228,18 @@ typedef enum : NSUInteger {
|
||||
*/
|
||||
- (NSAttributedString*)renderHTMLString:(NSString*)htmlString forEvent:(MXEvent*)event withRoomState:(MXRoomState*)roomState;
|
||||
|
||||
/**
|
||||
Render a random html string into an attributed string with the font and the text color
|
||||
that correspond to the passed event.
|
||||
|
||||
@param htmlString the HTLM string to render.
|
||||
@param event the event associated to the string.
|
||||
@param roomState the room state right before the event.
|
||||
@param isEditMode wether string will be used for edition in the composer
|
||||
@return an attributed string.
|
||||
*/
|
||||
- (NSAttributedString*)renderHTMLString:(NSString*)htmlString forEvent:(MXEvent*)event withRoomState:(MXRoomState*)roomState isEditMode:(BOOL)isEditMode;
|
||||
|
||||
/**
|
||||
Same as [self renderString:forEvent:] but add a prefix.
|
||||
The prefix will be rendered with 'prefixTextFont' and 'prefixTextColor'.
|
||||
|
||||
@@ -1751,11 +1751,17 @@ static NSString *const kHTMLATagRegexPattern = @"<a href=\"(.*?)\">([^<]*)</a>";
|
||||
}
|
||||
|
||||
- (NSAttributedString*)renderHTMLString:(NSString*)htmlString forEvent:(MXEvent*)event withRoomState:(MXRoomState*)roomState
|
||||
{
|
||||
return [self renderHTMLString:htmlString forEvent:event withRoomState:roomState isEditMode:NO];
|
||||
}
|
||||
|
||||
- (NSAttributedString*)renderHTMLString:(NSString*)htmlString forEvent:(MXEvent*)event withRoomState:(MXRoomState*)roomState isEditMode:(BOOL)isEditMode
|
||||
{
|
||||
NSString *html = htmlString;
|
||||
|
||||
// Special treatment for "In reply to" message
|
||||
if (event.isReplyEvent || (!RiotSettings.shared.enableThreads && event.isInThread))
|
||||
// Note: `isEditMode` fixes an issue where editing a reply would display an "In reply to" span instead of a mention.
|
||||
if (!isEditMode && (event.isReplyEvent || (!RiotSettings.shared.enableThreads && event.isInThread)))
|
||||
{
|
||||
html = [self renderReplyTo:html withRoomState:roomState];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user