~f4814n/frost

abcd6e72b355822384a3244234ae055345acab60 — Fabian Geiselhart 3 months ago 1eee816
Bump matrix version
6 files changed, 39 insertions(+), 6 deletions(-)

A cmd/frost/logger.go
M cmd/frost/main.go
M go.mod
M go.sum
D logger.go
M view/roomhistory/event.go
A cmd/frost/logger.go => cmd/frost/logger.go +34 -0
@@ 0,0 1,34 @@
package main

import (
	"go.uber.org/zap"
	"git.sr.ht/~f4814n/matrix"
)

type MatrixLogger struct {
	*zap.SugaredLogger
}

func (l MatrixLogger) Named(name string) matrix.Logger {
	return MatrixLogger{l.SugaredLogger.Named(name)}
}

func (l MatrixLogger) Debug(msg string, keysAndValues ...interface{}) {
	l.SugaredLogger.Debugw(msg, keysAndValues...)
}

func (l MatrixLogger) Info(msg string, keysAndValues ...interface{}) {
	l.SugaredLogger.Infow(msg, keysAndValues...)
}

func (l MatrixLogger) Warn(msg string, keysAndValues ...interface{}) {
	l.SugaredLogger.Warnw(msg, keysAndValues...)
}

func (l MatrixLogger) Error(msg string, keysAndValues ...interface{}) {
	l.SugaredLogger.Errorw(msg, keysAndValues...)
}

func (l MatrixLogger) Fatal(msg string, keysAndValues ...interface{}) {
	l.SugaredLogger.Fatalw(msg, keysAndValues...)
}

M cmd/frost/main.go => cmd/frost/main.go +1 -0
@@ 70,6 70,7 @@ func newApp() *App {
		cli: matrix.NewClient(matrix.ClientOpts{
			HTTPClient: http.DefaultClient,
			Backend:    backend,
			Logger:     MatrixLogger{logger.Named("matrix").Sugar()},
		}),
		window: app.NewWindow(
			app.Size(unit.Dp(400), unit.Dp(800)),

M go.mod => go.mod +1 -1
@@ 5,7 5,7 @@ go 1.14
require (
	gioui.org v0.0.0-20201224113856-0416fffc096b
	gioui.org/cmd v0.0.0-20201020094634-d5bdf0756a5a
	git.sr.ht/~f4814n/matrix v0.0.0-20201218143803-770e10bd6252
	git.sr.ht/~f4814n/matrix v0.0.0-20210109173214-a4eb7ce0da5c
	git.sr.ht/~whereswaldon/materials v0.0.0-20201220015048-3f4fb49d1fd9
	go.uber.org/zap v1.16.0
	golang.org/x/exp v0.0.0-20201203231725-fa01524bc59d

M go.sum => go.sum +2 -0
@@ 7,6 7,8 @@ gioui.org/cmd v0.0.0-20201020094634-d5bdf0756a5a h1:BPgJqeQSxuX6CzFQ2EGDj4Kr2Zzw
gioui.org/cmd v0.0.0-20201020094634-d5bdf0756a5a/go.mod h1:dlmJnCEkOpRaChYxRmJZ5S4jk6y7DCfWnec39xGbUYk=
git.sr.ht/~f4814n/matrix v0.0.0-20201218143803-770e10bd6252 h1:82PU+gyoqJQWqdCZ5aefQ0YtIbcTlpCGQ1366UEChpc=
git.sr.ht/~f4814n/matrix v0.0.0-20201218143803-770e10bd6252/go.mod h1:yR3YNkJR8S3qLkGh178oKRm3MnsT5cERNEXOF8eFOIo=
git.sr.ht/~f4814n/matrix v0.0.0-20210109173214-a4eb7ce0da5c h1:ViWW5NnBmVHdRrHzgXcZxDtyDHvPzv61HdivQ2z39W4=
git.sr.ht/~f4814n/matrix v0.0.0-20210109173214-a4eb7ce0da5c/go.mod h1:yR3YNkJR8S3qLkGh178oKRm3MnsT5cERNEXOF8eFOIo=
git.sr.ht/~whereswaldon/materials v0.0.0-20201220015048-3f4fb49d1fd9 h1:rb+UW4XloZFJvW022LJ++VyDRilIAcgEJbBLX3xtXd4=
git.sr.ht/~whereswaldon/materials v0.0.0-20201220015048-3f4fb49d1fd9/go.mod h1:evzscth58GGa3fzjGHmL2aR//0YLi52UfgfyTGFpMCM=
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=

D logger.go => logger.go +0 -4
@@ 1,4 0,0 @@
package frost

type Logger interface {
}

M view/roomhistory/event.go => view/roomhistory/event.go +1 -1
@@ 132,7 132,7 @@ func newMessageEvent(own bool, matrixEvent matrix.RoomEvent) messageEvent {

	if matrixEvent.Type == "m.room.encrypted" {
		var err error
		matrixEvent, err = matrixEvent.Decrypted()
		matrixEvent, err = matrixEvent.Decrypt()
		if err != nil {
			event.Text = err.Error()
			event.Invalid = true