Eagerly generate nip29 admins and members lists

This commit is contained in:
Jon Staab
2025-10-30 13:43:37 -07:00
parent e76293c742
commit f375e70a42
3 changed files with 26 additions and 59 deletions
+4 -8
View File
@@ -98,7 +98,7 @@ func (g *GroupStore) GetAdmins(h string) []nostr.PubKey {
return g.Management.GetAdmins()
}
func (g *GroupStore) GenerateAdminsEvent(h string) nostr.Event {
func (g *GroupStore) UpdateAdminsList(h string) error {
tags := nostr.Tags{
nostr.Tag{"-"},
nostr.Tag{"d", h},
@@ -114,9 +114,7 @@ func (g *GroupStore) GenerateAdminsEvent(h string) nostr.Event {
Tags: tags,
}
g.Config.Sign(&event)
return event
return g.Events.SignAndStoreEvent(&event, true)
}
// Membership
@@ -194,7 +192,7 @@ func (g *GroupStore) GetMembers(h string) []nostr.PubKey {
return members
}
func (g *GroupStore) GenerateMembersEvent(h string) nostr.Event {
func (g *GroupStore) UpdateMembersList(h string) error {
tags := nostr.Tags{
nostr.Tag{"-"},
nostr.Tag{"d", h},
@@ -210,9 +208,7 @@ func (g *GroupStore) GenerateMembersEvent(h string) nostr.Event {
Tags: tags,
}
g.Config.Sign(&event)
return event
return g.Events.SignAndStoreEvent(&event, true)
}
// Other stuff