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

@@ -14,6 +14,20 @@ var migrations = []string{}
// settings of a room
type settings struct {
Mailbox string
Owner id.UserID
}
// Allowed checks if change is allowed
func (s *settings) Allowed(noowner bool, userID id.UserID) bool {
if noowner {
return true
}
if s.Owner == "" {
return true
}
return s.Owner == userID
}
func (b *Bot) migrate() error {