minor refactor on storing display names

This commit is contained in:
Ryan ZHAO
2021-04-22 10:48:19 +10:00
parent 9f26436041
commit d78dc83307
6 changed files with 21 additions and 23 deletions

View File

@@ -93,12 +93,6 @@ class Storage(context: Context, helper: SQLCipherOpenHelper) : Database(context,
return database.getDisplayName(recipientPublicKey)
}
override fun setProfileKeyForRecipient(recipientPublicKey: String, profileKey: ByteArray) {
val address = Address.fromSerialized(recipientPublicKey)
val recipient = Recipient.from(context, address, false)
DatabaseFactory.getRecipientDatabase(context).setProfileKey(recipient, profileKey)
}
override fun getOrGenerateRegistrationID(): Int {
var registrationID = TextSecurePreferences.getLocalRegistrationId(context)
if (registrationID == 0) {
@@ -529,14 +523,6 @@ class Storage(context: Context, helper: SQLCipherOpenHelper) : Database(context,
return DatabaseFactory.getLokiUserDatabase(context).getDisplayName(publicKey)
}
override fun setDisplayName(publicKey: String, newName: String) {
DatabaseFactory.getLokiUserDatabase(context).setDisplayName(publicKey, newName)
}
override fun getServerDisplayName(serverID: String, publicKey: String): String? {
return DatabaseFactory.getLokiUserDatabase(context).getServerDisplayName(serverID, publicKey)
}
override fun getProfilePictureURL(publicKey: String): String? {
return DatabaseFactory.getLokiUserDatabase(context).getProfilePictureURL(publicKey)
}