mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-09-17 19:13:56 +02:00
nip29: update to latest NIP version (change some kinds and remove permissions and moderation stuff).
This commit is contained in:
12
nip29/utils.go
Normal file
12
nip29/utils.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package nip29
|
||||
|
||||
import "slices"
|
||||
|
||||
func (group Group) GetRoleByName(name string) *Role {
|
||||
idx := slices.IndexFunc(group.Roles, func(role *Role) bool { return role.Name == name })
|
||||
if idx == -1 {
|
||||
return &Role{Name: name}
|
||||
} else {
|
||||
return group.Roles[idx]
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user