mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-29 04:55:15 +00:00
Updated group naming
This commit is contained in:
parent
2e1f9a3931
commit
1161bac76c
@ -58,14 +58,14 @@ class ProfilePictureView @JvmOverloads constructor(
|
|||||||
|
|
||||||
fun update(
|
fun update(
|
||||||
address: Address,
|
address: Address,
|
||||||
isLegacyClosedGroupRecipient: Boolean = false,
|
isLegacyGroupRecipient: Boolean = false,
|
||||||
isOpenGroupInboxRecipient: Boolean = false
|
isCommunityInboxRecipient: Boolean = false
|
||||||
) {
|
) {
|
||||||
fun getUserDisplayName(publicKey: String): String = prefs.takeIf { userPublicKey == publicKey }?.getProfileName()
|
fun getUserDisplayName(publicKey: String): String = prefs.takeIf { userPublicKey == publicKey }?.getProfileName()
|
||||||
?: DatabaseComponent.get(context).sessionContactDatabase().getContactWithAccountID(publicKey)?.displayName(Contact.ContactContext.REGULAR)
|
?: DatabaseComponent.get(context).sessionContactDatabase().getContactWithAccountID(publicKey)?.displayName(Contact.ContactContext.REGULAR)
|
||||||
?: publicKey
|
?: publicKey
|
||||||
|
|
||||||
if (isLegacyClosedGroupRecipient) {
|
if (isLegacyGroupRecipient) {
|
||||||
val members = DatabaseComponent.get(context).groupDatabase()
|
val members = DatabaseComponent.get(context).groupDatabase()
|
||||||
.getGroupMemberAddresses(address.toGroupString(), true)
|
.getGroupMemberAddresses(address.toGroupString(), true)
|
||||||
.sorted()
|
.sorted()
|
||||||
@ -83,7 +83,7 @@ class ProfilePictureView @JvmOverloads constructor(
|
|||||||
additionalPublicKey = apk
|
additionalPublicKey = apk
|
||||||
additionalDisplayName = getUserDisplayName(apk)
|
additionalDisplayName = getUserDisplayName(apk)
|
||||||
}
|
}
|
||||||
} else if(isOpenGroupInboxRecipient) {
|
} else if(isCommunityInboxRecipient) {
|
||||||
val publicKey = GroupUtil.getDecodedOpenGroupInboxAccountId(address.serialize())
|
val publicKey = GroupUtil.getDecodedOpenGroupInboxAccountId(address.serialize())
|
||||||
this.publicKey = publicKey
|
this.publicKey = publicKey
|
||||||
displayName = getUserDisplayName(publicKey)
|
displayName = getUserDisplayName(publicKey)
|
||||||
|
@ -32,6 +32,13 @@ import java.util.Collections;
|
|||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
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 {
|
public class GroupDatabase extends Database implements LokiOpenGroupDatabaseProtocol {
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
|
Loading…
Reference in New Issue
Block a user