Skip to content

Commit fa9a7d0

Browse files
author
Jon Staab
committed
Allow fetching metadata for private groups, fix member list updates
1 parent da9110a commit fa9a7d0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

zooid/groups.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ func (g *GroupStore) GetMembers(h string) []nostr.PubKey {
188188

189189
for event := range g.Events.QueryEvents(filter, 0) {
190190
for hex := range event.Tags.FindAll("p") {
191-
if pubkey, err := nostr.PubKeyFromHex(hex[1]); err != nil {
191+
if pubkey, err := nostr.PubKeyFromHex(hex[1]); err == nil {
192192
if event.Kind == nostr.KindSimpleGroupPutUser {
193193
members = append(members, pubkey)
194194
} else {
@@ -263,6 +263,14 @@ func (g *GroupStore) CanRead(pubkey nostr.PubKey, event nostr.Event) bool {
263263
return false
264264
}
265265

266+
if event.Kind == nostr.KindSimpleGroupMetadata {
267+
return true
268+
}
269+
270+
if event.Kind == nostr.KindSimpleGroupDeleteGroup {
271+
return true
272+
}
273+
266274
if HasTag(meta.Tags, "private") && !g.HasAccess(h, pubkey) {
267275
return false
268276
}

0 commit comments

Comments
 (0)