always reply to a specific message; moved matrix-related utils to the linkpearl; refactoring

This commit is contained in:
Aine
2023-09-27 12:43:55 +03:00
parent e2f5f4c731
commit 816db6f409
18 changed files with 270 additions and 279 deletions

View File

@@ -7,7 +7,6 @@ import (
"strings"
"time"
"github.com/getsentry/sentry-go"
"github.com/raja/argon2pw"
"gitlab.com/etke.cc/go/mxidwc"
"maunium.net/go/mautrix/id"
@@ -43,7 +42,7 @@ func (b *Bot) allowOwner(actorID id.UserID, targetRoomID id.RoomID) bool {
}
cfg, err := b.cfg.GetRoom(targetRoomID)
if err != nil {
b.Error(sentry.SetHubOnContext(context.Background(), sentry.CurrentHub()), targetRoomID, "failed to retrieve settings: %v", err)
b.Error(context.Background(), "failed to retrieve settings: %v", err)
return false
}
@@ -66,7 +65,7 @@ func (b *Bot) allowSend(actorID id.UserID, targetRoomID id.RoomID) bool {
cfg, err := b.cfg.GetRoom(targetRoomID)
if err != nil {
b.Error(sentry.SetHubOnContext(context.Background(), sentry.CurrentHub()), targetRoomID, "failed to retrieve settings: %v", err)
b.Error(context.Background(), "failed to retrieve settings: %v", err)
return false
}
@@ -80,7 +79,7 @@ func (b *Bot) allowReply(actorID id.UserID, targetRoomID id.RoomID) bool {
cfg, err := b.cfg.GetRoom(targetRoomID)
if err != nil {
b.Error(sentry.SetHubOnContext(context.Background(), sentry.CurrentHub()), targetRoomID, "failed to retrieve settings: %v", err)
b.Error(context.Background(), "failed to retrieve settings: %v", err)
return false
}