Improve delete group
This commit is contained in:
+5
-1
@@ -2,6 +2,7 @@ package zooid
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fiatjaf.com/nostr"
|
"fiatjaf.com/nostr"
|
||||||
|
"fiatjaf.com/nostr/nip29"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Utils
|
// Utils
|
||||||
@@ -66,6 +67,7 @@ func (g *GroupStore) SetMetadataFromEvent(event nostr.Event) error {
|
|||||||
func (g *GroupStore) DeleteGroup(h string) {
|
func (g *GroupStore) DeleteGroup(h string) {
|
||||||
filters := []nostr.Filter{
|
filters := []nostr.Filter{
|
||||||
{
|
{
|
||||||
|
Kinds: nip29.MetadataEventKinds,
|
||||||
Tags: nostr.TagMap{
|
Tags: nostr.TagMap{
|
||||||
"d": []string{h},
|
"d": []string{h},
|
||||||
},
|
},
|
||||||
@@ -79,7 +81,9 @@ func (g *GroupStore) DeleteGroup(h string) {
|
|||||||
|
|
||||||
for _, filter := range filters {
|
for _, filter := range filters {
|
||||||
for event := range g.Events.QueryEvents(filter, 0) {
|
for event := range g.Events.QueryEvents(filter, 0) {
|
||||||
g.Events.DeleteEvent(event.ID)
|
if event.Kind != nostr.KindSimpleGroupDeleteEvent {
|
||||||
|
g.Events.DeleteEvent(event.ID)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -66,14 +66,15 @@ func MakeInstance(filename string) (*Instance, error) {
|
|||||||
|
|
||||||
// NIP 11 info
|
// NIP 11 info
|
||||||
|
|
||||||
|
// self := config.GetSelf()
|
||||||
owner := config.GetOwner()
|
owner := config.GetOwner()
|
||||||
|
|
||||||
instance.Relay.Negentropy = true
|
instance.Relay.Negentropy = true
|
||||||
instance.Relay.Info.Name = config.Info.Name
|
instance.Relay.Info.Name = config.Info.Name
|
||||||
instance.Relay.Info.Icon = config.Info.Icon
|
instance.Relay.Info.Icon = config.Info.Icon
|
||||||
|
// instance.Relay.Info.Self = &self
|
||||||
instance.Relay.Info.PubKey = &owner
|
instance.Relay.Info.PubKey = &owner
|
||||||
instance.Relay.Info.Description = config.Info.Description
|
instance.Relay.Info.Description = config.Info.Description
|
||||||
// instance.Relay.Info.Self = nostr.GetPublicKey(secret)
|
|
||||||
instance.Relay.Info.Software = "https://github.com/coracle-social/zooid"
|
instance.Relay.Info.Software = "https://github.com/coracle-social/zooid"
|
||||||
instance.Relay.Info.Version = "v0.1.0"
|
instance.Relay.Info.Version = "v0.1.0"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user