BREAKING: update mautrix to 0.15.x
This commit is contained in:
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user