mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-11-10 22:19:35 +01:00
Update addFollowSet() method to optionally create a list with first member.
This commit is contained in:
@@ -118,6 +118,7 @@ class NostrUserListFeedViewModel(
|
|||||||
setName: String,
|
setName: String,
|
||||||
setDescription: String?,
|
setDescription: String?,
|
||||||
isListPrivate: Boolean,
|
isListPrivate: Boolean,
|
||||||
|
optionalFirstMemberHex: String? = null,
|
||||||
account: Account,
|
account: Account,
|
||||||
) {
|
) {
|
||||||
if (!account.settings.isWriteable()) {
|
if (!account.settings.isWriteable()) {
|
||||||
@@ -129,6 +130,7 @@ class NostrUserListFeedViewModel(
|
|||||||
title = setName,
|
title = setName,
|
||||||
description = setDescription,
|
description = setDescription,
|
||||||
isPrivate = isListPrivate,
|
isPrivate = isListPrivate,
|
||||||
|
firstMemberHex = optionalFirstMemberHex,
|
||||||
signer = account.signer,
|
signer = account.signer,
|
||||||
) {
|
) {
|
||||||
account.sendMyPublicAndPrivateOutbox(it)
|
account.sendMyPublicAndPrivateOutbox(it)
|
||||||
|
|||||||
@@ -219,6 +219,7 @@ class PeopleListEvent(
|
|||||||
title: String,
|
title: String,
|
||||||
description: String? = null,
|
description: String? = null,
|
||||||
isPrivate: Boolean,
|
isPrivate: Boolean,
|
||||||
|
firstMemberHex: String? = null,
|
||||||
signer: NostrSigner,
|
signer: NostrSigner,
|
||||||
createdAt: Long = TimeUtils.now(),
|
createdAt: Long = TimeUtils.now(),
|
||||||
onReady: (PeopleListEvent) -> Unit,
|
onReady: (PeopleListEvent) -> Unit,
|
||||||
@@ -227,7 +228,7 @@ class PeopleListEvent(
|
|||||||
val newList =
|
val newList =
|
||||||
create(
|
create(
|
||||||
name = title,
|
name = title,
|
||||||
person = UserTag(pubKey = signer.pubKey),
|
person = UserTag(pubKey = firstMemberHex ?: signer.pubKey),
|
||||||
isPrivate = isPrivate,
|
isPrivate = isPrivate,
|
||||||
signer = signer,
|
signer = signer,
|
||||||
dTag = dTag,
|
dTag = dTag,
|
||||||
@@ -239,7 +240,7 @@ class PeopleListEvent(
|
|||||||
val event =
|
val event =
|
||||||
build(
|
build(
|
||||||
name = title,
|
name = title,
|
||||||
privatePeople = listOf(UserTag(pubKey = signer.pubKey)),
|
privatePeople = listOf(UserTag(pubKey = firstMemberHex ?: signer.pubKey)),
|
||||||
signer = signer,
|
signer = signer,
|
||||||
dTag = dTag,
|
dTag = dTag,
|
||||||
createdAt = createdAt,
|
createdAt = createdAt,
|
||||||
@@ -252,7 +253,7 @@ class PeopleListEvent(
|
|||||||
val event =
|
val event =
|
||||||
build(
|
build(
|
||||||
name = title,
|
name = title,
|
||||||
publicPeople = listOf(UserTag(pubKey = signer.pubKey)),
|
publicPeople = listOf(UserTag(pubKey = firstMemberHex ?: signer.pubKey)),
|
||||||
signer = signer,
|
signer = signer,
|
||||||
dTag = dTag,
|
dTag = dTag,
|
||||||
createdAt = createdAt,
|
createdAt = createdAt,
|
||||||
|
|||||||
Reference in New Issue
Block a user