mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-16 06:28:27 +02:00
feat: use username instead of displayname (MESSENGER-7565)
This commit is contained in:
@@ -1899,7 +1899,7 @@ NSString *const kRecentsDataSourceTapOnDirectoryServerChange = @"kRecentsDataSou
|
||||
|
||||
MigrationAssistant *migrationAssistant = [[MigrationAssistant alloc] init];
|
||||
|
||||
BOOL retVal = [migrationAssistant storeDisplaynameWithSession:session];
|
||||
BOOL retVal = [migrationAssistant storeUsernameWithSession:session];
|
||||
if ( retVal == false) {
|
||||
MXLogError(@"[RecentsDataSource] shouldShowFeatureBanner could not store displaname for migration")
|
||||
}
|
||||
|
||||
@@ -22,13 +22,16 @@ import MatrixSDK
|
||||
// reads user name and displayName from session and stores in shared keychain
|
||||
|
||||
@objcMembers class MigrationAssistant : NSObject {
|
||||
func storeDisplayname( session: MXSession ) -> Bool {
|
||||
func storeUsername( session: MXSession ) -> Bool {
|
||||
|
||||
var returnValue = false
|
||||
|
||||
if let displayname = session.myUser.displayName {
|
||||
let ossStatus = SharedKeychain.save(account: "migration_displayname", value: displayname)
|
||||
returnValue = ossStatus == errSecSuccess
|
||||
if let fullID = session.myUser.userId {
|
||||
let withoutAt = fullID.hasPrefix("@") ? String(fullID.dropFirst()) : fullID
|
||||
if let username = withoutAt.split(separator: ":").first {
|
||||
let ossStatus = SharedKeychain.save(account: "migration_username", value: String(username))
|
||||
returnValue = ossStatus == errSecSuccess
|
||||
}
|
||||
}
|
||||
|
||||
return returnValue
|
||||
|
||||
Reference in New Issue
Block a user