diff --git a/README.md b/README.md index 966222c..00c1adc 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,6 @@ env vars
other optional config parameters -* **POSTMOOGLE_NOOWNER** - allow change room settings by any room partisipant * **POSTMOOGLE_NOENCRYPTION** - disable encryption support * **POSTMOOGLE_STATUSMSG** - presence status message * **POSTMOOGLE_SENTRY_DSN** - sentry DSN @@ -81,6 +80,7 @@ If you want to change them - check available options in the help message (`!pm h --- * **!pm mailboxes** - Show the list of all mailboxes +* **!pm delete** <mailbox> - Delete specific mailbox
diff --git a/bot/access.go b/bot/access.go index 297cf1c..08b2967 100644 --- a/bot/access.go +++ b/bot/access.go @@ -19,10 +19,6 @@ func (b *Bot) allowOwner(actorID id.UserID, targetRoomID id.RoomID) bool { } } - if b.noowner { - return true - } - cfg, err := b.getSettings(targetRoomID) if err != nil { b.Error(context.Background(), targetRoomID, "failed to retrieve settings: %v", err) diff --git a/bot/bot.go b/bot/bot.go index 3e0a92c..cd5f7e4 100644 --- a/bot/bot.go +++ b/bot/bot.go @@ -17,7 +17,6 @@ import ( // Bot represents matrix bot type Bot struct { - noowner bool prefix string domain string allowedUsers []*regexp.Regexp @@ -37,12 +36,10 @@ func New( log *logger.Logger, prefix string, domain string, - noowner bool, allowedUsers []*regexp.Regexp, allowedAdmins []*regexp.Regexp, ) *Bot { b := &Bot{ - noowner: noowner, prefix: prefix, domain: domain, allowedUsers: allowedUsers, diff --git a/cmd/cmd.go b/cmd/cmd.go index 41671b9..1ce08ba 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -87,7 +87,7 @@ func initBot(cfg *config.Config) { // nolint // Fatal = panic, not os.Exit() log.Fatal("cannot initialize matrix bot: %v", err) } - mxb = bot.New(lp, mxlog, cfg.Prefix, cfg.Domain, cfg.NoOwner, cfg.Users, cfg.Admins) + mxb = bot.New(lp, mxlog, cfg.Prefix, cfg.Domain, cfg.Users, cfg.Admins) log.Debug("bot has been created") } diff --git a/config/config.go b/config/config.go index c6fad30..a4b11db 100644 --- a/config/config.go +++ b/config/config.go @@ -33,7 +33,6 @@ func New() (*Config, error) { Domain: env.String("domain", defaultConfig.Domain), Port: env.String("port", defaultConfig.Port), NoEncryption: env.Bool("noencryption"), - NoOwner: env.Bool("noowner"), MaxSize: env.Int("maxsize", defaultConfig.MaxSize), StatusMsg: env.String("statusmsg", defaultConfig.StatusMsg), Users: userPatterns, diff --git a/config/types.go b/config/types.go index 9158e85..94566b6 100644 --- a/config/types.go +++ b/config/types.go @@ -18,8 +18,6 @@ type Config struct { LogLevel string // NoEncryption disabled encryption support NoEncryption bool - // NoOwner allows room settings change by any participant - NoOwner bool // Prefix for commands Prefix string // MaxSize of an email (including attachments)