Upload the right display name to open group from the slave device

This commit is contained in:
ryanzhao 2020-06-09 10:41:42 +10:00
parent d9bca8b5b9
commit 335704c362
2 changed files with 4 additions and 2 deletions

View file

@ -133,7 +133,8 @@ final class JoinPublicChatVC : BaseVC, UIPageViewControllerDataSource, UIPageVie
isJoining = true
let channelID: UInt64 = 1
let urlAsString = url.absoluteString
let displayName = OWSProfileManager.shared().localProfileName()
let userHexEncodedPublicKey = UserDefaults.standard[.masterHexEncodedPublicKey] ?? getUserHexEncodedPublicKey()
let displayName = OWSProfileManager.shared().profileNameForRecipient(withID: userHexEncodedPublicKey)
let profilePictureURL = OWSProfileManager.shared().profilePictureURL()
let profileKey = OWSProfileManager.shared().localProfileKey().keyData
LokiPublicChatManager.shared.addChat(server: urlAsString, channel: channelID)

View file

@ -19,7 +19,8 @@ public final class LokiPublicChatAPI : LokiDotNetAPI {
// MARK: Convenience
private static var userDisplayName: String {
return SSKEnvironment.shared.contactsManager.displayName(forPhoneIdentifier: getUserHexEncodedPublicKey()) ?? "Anonymous"
let userHexEncodedPublicKey = UserDefaults.standard[.masterHexEncodedPublicKey] ?? getUserHexEncodedPublicKey()
return SSKEnvironment.shared.profileManager.profileNameForRecipient(withID: userHexEncodedPublicKey) ?? "Anonymous"
}
// MARK: Database