add noowner and federation

This commit is contained in:
Aine
2022-08-22 22:08:32 +03:00
parent 564cd82c6b
commit 0decd4fad6
9 changed files with 129 additions and 13 deletions

View File

@@ -86,6 +86,13 @@ func (b *Bot) setMailbox(ctx context.Context, evt *event.Event, mailbox string)
if cfg == nil {
cfg = &settings{}
}
if !cfg.Allowed(b.noowner, evt.Sender) {
b.Error(span.Context(), evt.RoomID, "you don't have permission to do that")
return
}
cfg.Owner = evt.Sender
cfg.Mailbox = mailbox
err = b.setSettings(span.Context(), evt.RoomID, cfg)
if err != nil {