mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-28 20:45:17 +00:00
Updated group naming
This commit is contained in:
parent
2e1f9a3931
commit
1161bac76c
@ -58,14 +58,14 @@ class ProfilePictureView @JvmOverloads constructor(
|
||||
|
||||
fun update(
|
||||
address: Address,
|
||||
isLegacyClosedGroupRecipient: Boolean = false,
|
||||
isOpenGroupInboxRecipient: Boolean = false
|
||||
isLegacyGroupRecipient: Boolean = false,
|
||||
isCommunityInboxRecipient: Boolean = false
|
||||
) {
|
||||
fun getUserDisplayName(publicKey: String): String = prefs.takeIf { userPublicKey == publicKey }?.getProfileName()
|
||||
?: DatabaseComponent.get(context).sessionContactDatabase().getContactWithAccountID(publicKey)?.displayName(Contact.ContactContext.REGULAR)
|
||||
?: publicKey
|
||||
|
||||
if (isLegacyClosedGroupRecipient) {
|
||||
if (isLegacyGroupRecipient) {
|
||||
val members = DatabaseComponent.get(context).groupDatabase()
|
||||
.getGroupMemberAddresses(address.toGroupString(), true)
|
||||
.sorted()
|
||||
@ -83,7 +83,7 @@ class ProfilePictureView @JvmOverloads constructor(
|
||||
additionalPublicKey = apk
|
||||
additionalDisplayName = getUserDisplayName(apk)
|
||||
}
|
||||
} else if(isOpenGroupInboxRecipient) {
|
||||
} else if(isCommunityInboxRecipient) {
|
||||
val publicKey = GroupUtil.getDecodedOpenGroupInboxAccountId(address.serialize())
|
||||
this.publicKey = publicKey
|
||||
displayName = getUserDisplayName(publicKey)
|
||||
|
@ -32,6 +32,13 @@ import java.util.Collections;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @deprecated This database table management is only used for
|
||||
* legacy group management. It is not used in groupv2. For group v2 data, you generally need
|
||||
* to query config system directly. The Storage class may also be more up-to-date.
|
||||
*
|
||||
*/
|
||||
@Deprecated
|
||||
public class GroupDatabase extends Database implements LokiOpenGroupDatabaseProtocol {
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
|
Loading…
Reference in New Issue
Block a user