Auto-approve join request if the room is not closed
This commit is contained in:
+6
-2
@@ -387,8 +387,12 @@ func (instance *Instance) OnEventSaved(ctx context.Context, event nostr.Event) {
|
|||||||
h := GetGroupIDFromEvent(event)
|
h := GetGroupIDFromEvent(event)
|
||||||
|
|
||||||
if event.Kind == nostr.KindSimpleGroupJoinRequest {
|
if event.Kind == nostr.KindSimpleGroupJoinRequest {
|
||||||
instance.Groups.AddMember(h, event.PubKey)
|
meta, ok := instance.Groups.GetMetadata(h)
|
||||||
instance.Groups.UpdateMembersList(h)
|
|
||||||
|
if ok && !meta.Tags.Has("closed") {
|
||||||
|
instance.Groups.AddMember(h, event.PubKey)
|
||||||
|
instance.Groups.UpdateMembersList(h)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if event.Kind == nostr.KindSimpleGroupLeaveRequest {
|
if event.Kind == nostr.KindSimpleGroupLeaveRequest {
|
||||||
|
|||||||
Reference in New Issue
Block a user