remove NOOWNER, closes #14
This commit is contained in:
@@ -34,7 +34,6 @@ env vars
|
|||||||
<details>
|
<details>
|
||||||
<summary>other optional config parameters</summary>
|
<summary>other optional config parameters</summary>
|
||||||
|
|
||||||
* **POSTMOOGLE_NOOWNER** - allow change room settings by any room partisipant
|
|
||||||
* **POSTMOOGLE_NOENCRYPTION** - disable encryption support
|
* **POSTMOOGLE_NOENCRYPTION** - disable encryption support
|
||||||
* **POSTMOOGLE_STATUSMSG** - presence status message
|
* **POSTMOOGLE_STATUSMSG** - presence status message
|
||||||
* **POSTMOOGLE_SENTRY_DSN** - sentry DSN
|
* **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 mailboxes** - Show the list of all mailboxes
|
||||||
|
* **!pm delete** <mailbox> - Delete specific mailbox
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
|||||||
@@ -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)
|
cfg, err := b.getSettings(targetRoomID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
b.Error(context.Background(), targetRoomID, "failed to retrieve settings: %v", err)
|
b.Error(context.Background(), targetRoomID, "failed to retrieve settings: %v", err)
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ import (
|
|||||||
|
|
||||||
// Bot represents matrix bot
|
// Bot represents matrix bot
|
||||||
type Bot struct {
|
type Bot struct {
|
||||||
noowner bool
|
|
||||||
prefix string
|
prefix string
|
||||||
domain string
|
domain string
|
||||||
allowedUsers []*regexp.Regexp
|
allowedUsers []*regexp.Regexp
|
||||||
@@ -37,12 +36,10 @@ func New(
|
|||||||
log *logger.Logger,
|
log *logger.Logger,
|
||||||
prefix string,
|
prefix string,
|
||||||
domain string,
|
domain string,
|
||||||
noowner bool,
|
|
||||||
allowedUsers []*regexp.Regexp,
|
allowedUsers []*regexp.Regexp,
|
||||||
allowedAdmins []*regexp.Regexp,
|
allowedAdmins []*regexp.Regexp,
|
||||||
) *Bot {
|
) *Bot {
|
||||||
b := &Bot{
|
b := &Bot{
|
||||||
noowner: noowner,
|
|
||||||
prefix: prefix,
|
prefix: prefix,
|
||||||
domain: domain,
|
domain: domain,
|
||||||
allowedUsers: allowedUsers,
|
allowedUsers: allowedUsers,
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ func initBot(cfg *config.Config) {
|
|||||||
// nolint // Fatal = panic, not os.Exit()
|
// nolint // Fatal = panic, not os.Exit()
|
||||||
log.Fatal("cannot initialize matrix bot: %v", err)
|
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")
|
log.Debug("bot has been created")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ func New() (*Config, error) {
|
|||||||
Domain: env.String("domain", defaultConfig.Domain),
|
Domain: env.String("domain", defaultConfig.Domain),
|
||||||
Port: env.String("port", defaultConfig.Port),
|
Port: env.String("port", defaultConfig.Port),
|
||||||
NoEncryption: env.Bool("noencryption"),
|
NoEncryption: env.Bool("noencryption"),
|
||||||
NoOwner: env.Bool("noowner"),
|
|
||||||
MaxSize: env.Int("maxsize", defaultConfig.MaxSize),
|
MaxSize: env.Int("maxsize", defaultConfig.MaxSize),
|
||||||
StatusMsg: env.String("statusmsg", defaultConfig.StatusMsg),
|
StatusMsg: env.String("statusmsg", defaultConfig.StatusMsg),
|
||||||
Users: userPatterns,
|
Users: userPatterns,
|
||||||
|
|||||||
@@ -18,8 +18,6 @@ type Config struct {
|
|||||||
LogLevel string
|
LogLevel string
|
||||||
// NoEncryption disabled encryption support
|
// NoEncryption disabled encryption support
|
||||||
NoEncryption bool
|
NoEncryption bool
|
||||||
// NoOwner allows room settings change by any participant
|
|
||||||
NoOwner bool
|
|
||||||
// Prefix for commands
|
// Prefix for commands
|
||||||
Prefix string
|
Prefix string
|
||||||
// MaxSize of an email (including attachments)
|
// MaxSize of an email (including attachments)
|
||||||
|
|||||||
Reference in New Issue
Block a user