initial, rought, not-user-friendly support for multi-domain setup

This commit is contained in:
Aine
2022-11-08 18:16:38 +02:00
parent 8954a7801a
commit 15d5afe90f
14 changed files with 70 additions and 45 deletions

View File

@@ -19,7 +19,7 @@ import (
// Bot represents matrix bot
type Bot struct {
prefix string
domain string
domains []string
allowedUsers []*regexp.Regexp
allowedAdmins []*regexp.Regexp
commands commandList
@@ -36,16 +36,16 @@ func New(
lp *linkpearl.Linkpearl,
log *logger.Logger,
prefix string,
domain string,
domains []string,
admins []string,
) (*Bot, error) {
b := &Bot{
prefix: prefix,
domain: domain,
rooms: sync.Map{},
log: log,
lp: lp,
mu: map[id.RoomID]*sync.Mutex{},
prefix: prefix,
domains: domains,
rooms: sync.Map{},
log: log,
lp: lp,
mu: map[id.RoomID]*sync.Mutex{},
}
users, err := b.initBotUsers()
if err != nil {