mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-23 01:52:44 +02:00
Remove flairs and related groups.
This commit is contained in:
@@ -99,7 +99,6 @@ typedef enum : NSUInteger {
|
||||
@property (nonatomic) BOOL treatMatrixRoomIdAsLink;
|
||||
@property (nonatomic) BOOL treatMatrixRoomAliasAsLink;
|
||||
@property (nonatomic) BOOL treatMatrixEventIdAsLink;
|
||||
@property (nonatomic) BOOL treatMatrixGroupIdAsLink;
|
||||
|
||||
/**
|
||||
Initialise the event formatter.
|
||||
|
||||
@@ -1022,21 +1022,6 @@ static NSString *const kHTMLATagRegexPattern = @"<a href=(?:'|\")(.*?)(?:'|\")>(
|
||||
}
|
||||
break;
|
||||
}
|
||||
case MXEventTypeRoomRelatedGroups:
|
||||
{
|
||||
NSArray *groups;
|
||||
MXJSONModelSetArray(groups, event.content[@"groups"]);
|
||||
if (groups)
|
||||
{
|
||||
displayText = [VectorL10n noticeRoomRelatedGroups:[groups componentsJoinedByString:@", "]];
|
||||
// Append redacted info if any
|
||||
if (redactedInfo)
|
||||
{
|
||||
displayText = [NSString stringWithFormat:@"%@\n %@", displayText, redactedInfo];
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case MXEventTypeRoomEncrypted:
|
||||
{
|
||||
// Is redacted?
|
||||
@@ -2081,12 +2066,6 @@ static NSString *const kHTMLATagRegexPattern = @"<a href=(?:'|\")(.*?)(?:'|\")>(
|
||||
{
|
||||
enabledMatrixIdsBitMask |= MXKTOOLS_EVENT_IDENTIFIER_BITWISE;
|
||||
}
|
||||
|
||||
// If enabled, make group id clickable
|
||||
if (_treatMatrixGroupIdAsLink)
|
||||
{
|
||||
enabledMatrixIdsBitMask |= MXKTOOLS_GROUP_IDENTIFIER_BITWISE;
|
||||
}
|
||||
|
||||
[MXKTools createLinksInMutableAttributedString:mutableAttributedString forEnabledMatrixIds:enabledMatrixIdsBitMask];
|
||||
}
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#define MXKTOOLS_ROOM_IDENTIFIER_BITWISE 0x02
|
||||
#define MXKTOOLS_ROOM_ALIAS_BITWISE 0x04
|
||||
#define MXKTOOLS_EVENT_IDENTIFIER_BITWISE 0x08
|
||||
#define MXKTOOLS_GROUP_IDENTIFIER_BITWISE 0x10
|
||||
|
||||
// Attribute in an NSAttributeString that marks a blockquote block that was in the original HTML string.
|
||||
extern NSString *const kMXKToolsBlockquoteMarkAttribute;
|
||||
|
||||
@@ -42,7 +42,6 @@ static NSRegularExpression *userIdRegex;
|
||||
static NSRegularExpression *roomIdRegex;
|
||||
static NSRegularExpression *roomAliasRegex;
|
||||
static NSRegularExpression *eventIdRegex;
|
||||
static NSRegularExpression *groupIdRegex;
|
||||
// A regex to find http URLs.
|
||||
static NSRegularExpression *httpLinksRegex;
|
||||
// A regex to find all HTML tags
|
||||
@@ -59,7 +58,6 @@ static NSRegularExpression *htmlTagsRegex;
|
||||
roomIdRegex = [NSRegularExpression regularExpressionWithPattern:kMXToolsRegexStringForMatrixRoomIdentifier options:NSRegularExpressionCaseInsensitive error:nil];
|
||||
roomAliasRegex = [NSRegularExpression regularExpressionWithPattern:kMXToolsRegexStringForMatrixRoomAlias options:NSRegularExpressionCaseInsensitive error:nil];
|
||||
eventIdRegex = [NSRegularExpression regularExpressionWithPattern:kMXToolsRegexStringForMatrixEventIdentifier options:NSRegularExpressionCaseInsensitive error:nil];
|
||||
groupIdRegex = [NSRegularExpression regularExpressionWithPattern:kMXToolsRegexStringForMatrixGroupIdentifier options:NSRegularExpressionCaseInsensitive error:nil];
|
||||
|
||||
httpLinksRegex = [NSRegularExpression regularExpressionWithPattern:@"(?i)\\b(https?://\\S*)\\b" options:NSRegularExpressionCaseInsensitive error:nil];
|
||||
htmlTagsRegex = [NSRegularExpression regularExpressionWithPattern:@"<(\\w+)[^>]*>" options:NSRegularExpressionCaseInsensitive error:nil];
|
||||
@@ -1039,12 +1037,6 @@ manualChangeMessageForVideo:(NSString*)manualChangeMessageForVideo
|
||||
{
|
||||
[MXKTools createLinksInMutableAttributedString:mutableAttributedString matchingRegex:eventIdRegex];
|
||||
}
|
||||
|
||||
// If enabled, make group id clickable
|
||||
if (enabledMatrixIdsBitMask & MXKTOOLS_GROUP_IDENTIFIER_BITWISE)
|
||||
{
|
||||
[MXKTools createLinksInMutableAttributedString:mutableAttributedString matchingRegex:groupIdRegex];
|
||||
}
|
||||
}
|
||||
|
||||
+ (void)createLinksInMutableAttributedString:(NSMutableAttributedString*)mutableAttributedString matchingRegex:(NSRegularExpression*)regex
|
||||
|
||||
Reference in New Issue
Block a user