mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-18 07:28:28 +02:00
MESSENGER-5290 mark federated user status events
This commit is contained in:
@@ -695,7 +695,8 @@ static NSString *const kRepliedTextPattern = @"<mx-reply>.*<blockquote>.*<br>(.*
|
||||
targetDisplayName = contentDisplayname;
|
||||
}
|
||||
|
||||
displayText = [VectorL10n noticeRoomJoin:targetDisplayName];
|
||||
// bwi #5290 federated user get additional status text
|
||||
displayText = [self formattedJoinEvent: [VectorL10n noticeRoomJoin:targetDisplayName] room:[mxSession roomWithRoomId:event.roomId] userId:event.sender];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -740,7 +741,8 @@ static NSString *const kRepliedTextPattern = @"<mx-reply>.*<blockquote>.*<br>(.*
|
||||
}
|
||||
else
|
||||
{
|
||||
displayText = [BWIL10n noticeRoomLeave:targetDisplayName];
|
||||
// bwi #5290 federated user get additional status text
|
||||
displayText = [self formattedJoinEvent: [BWIL10n noticeRoomLeave:targetDisplayName] room:[mxSession roomWithRoomId:event.roomId] userId:event.sender];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2494,4 +2496,20 @@ static NSString *const kRepliedTextPattern = @"<mx-reply>.*<blockquote>.*<br>(.*
|
||||
return timeString.lowercaseString;
|
||||
}
|
||||
|
||||
#pragma mark - federation
|
||||
// bwi #5290 federated user get additional status text
|
||||
- (NSString *)formattedJoinEvent:(NSString *)localizedString room:(MXRoom *)room userId:(NSString *)userId {
|
||||
|
||||
if ( BWIBuildSettings.shared.isFederationEnabled && [room isRoomMemberFederated:userId]) {
|
||||
NSArray *memberUserIdComponents = [userId componentsSeparatedByString:@":"];
|
||||
|
||||
if (memberUserIdComponents.count == 2) {
|
||||
NSString *component = [memberUserIdComponents lastObject];
|
||||
return [localizedString stringByAppendingFormat:@" (%@)", component];
|
||||
}
|
||||
}
|
||||
|
||||
return localizedString;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -58,6 +58,7 @@ targets:
|
||||
- path: ../bwi/MatomoAnalytics/DecryptedEvent.swift
|
||||
- path: ../bwi/MatomoAnalytics/E2EEError.swift
|
||||
- path: ../bwi/URLScheme/CustomURLSchemeHelper.swift
|
||||
- path: ../bwi/Federation/MXRoom+Federation.swift
|
||||
- path: ../Riot/Managers/Settings/RiotSettings.swift
|
||||
- path: ../Config/BuildSettings.swift
|
||||
- path: ../Config/BWIBuildSettings.swift
|
||||
|
||||
Reference in New Issue
Block a user