Allow fetching metadata for private groups, fix member list updates

This commit is contained in:
Jon Staab
2025-11-03 08:31:36 -08:00
parent da9110a9c7
commit fa9a7d07f3
+9 -1
View File
@@ -188,7 +188,7 @@ func (g *GroupStore) GetMembers(h string) []nostr.PubKey {
for event := range g.Events.QueryEvents(filter, 0) {
for hex := range event.Tags.FindAll("p") {
if pubkey, err := nostr.PubKeyFromHex(hex[1]); err != nil {
if pubkey, err := nostr.PubKeyFromHex(hex[1]); err == nil {
if event.Kind == nostr.KindSimpleGroupPutUser {
members = append(members, pubkey)
} else {
@@ -263,6 +263,14 @@ func (g *GroupStore) CanRead(pubkey nostr.PubKey, event nostr.Event) bool {
return false
}
if event.Kind == nostr.KindSimpleGroupMetadata {
return true
}
if event.Kind == nostr.KindSimpleGroupDeleteGroup {
return true
}
if HasTag(meta.Tags, "private") && !g.HasAccess(h, pubkey) {
return false
}