BREAKING: update mautrix to 0.15.x

This commit is contained in:
Aine
2023-06-01 14:32:20 +00:00
parent a6b20a75ab
commit 2bdb8ca635
222 changed files with 7851 additions and 23986 deletions

View File

@@ -72,7 +72,7 @@ func ParseContent(evt *event.Event, eventType event.Type) {
}
perr := evt.Content.ParseRaw(eventType)
if perr != nil {
log.Error("cannot parse event content: %v", perr)
log.Error().Err(perr).Msg("cannot parse event content")
}
}

View File

@@ -5,16 +5,16 @@ import (
"strconv"
"strings"
"gitlab.com/etke.cc/go/logger"
"github.com/rs/zerolog"
)
var (
log *logger.Logger
log *zerolog.Logger
domains []string
)
// SetLogger for utils
func SetLogger(loggerInstance *logger.Logger) {
func SetLogger(loggerInstance *zerolog.Logger) {
log = loggerInstance
}
@@ -78,6 +78,19 @@ func Int(str string) int {
return i
}
// Int64 converts string into int64
func Int64(str string) int64 {
if str == "" {
return 0
}
i, err := strconv.ParseInt(str, 10, 64)
if err != nil {
return 0
}
return i
}
// SanitizeBoolString converts string to integer and back to string
func SanitizeIntString(str string) string {
return strconv.Itoa(Int(str))