add logtr.sosf for sos straight to specific matrix

This commit is contained in:
bel
2022-01-17 18:40:31 -07:00
parent 73ccc22fd5
commit a38a627f5a
6 changed files with 73 additions and 24 deletions

View File

@@ -16,7 +16,7 @@ func TestImageUpload(t *testing.T) {
if err != nil {
t.Fatal(err)
}
if err := config.Refresh(); err != nil {
if err := config.Refresh(nil); err != nil {
t.Fatal(err)
}
got, err := UploadImage(b)

View File

@@ -23,15 +23,24 @@ type Matrix struct {
continuation string
}
func NewSOSMatrix() logtr.SOSer {
conf := config.Get().Log.SOSMatrix
return newMatrix(conf, "0")
}
func NewMatrix() Matrix {
conf := config.Get().Message.Matrix
return newMatrix(conf, GetMatrixContinuation())
}
func newMatrix(conf config.Matrix, cont string) Matrix {
return Matrix{
homeserver: conf.Homeserver,
username: conf.Username,
token: conf.Token,
room: conf.Room,
mock: conf.Mock,
continuation: GetMatrixContinuation(),
continuation: cont,
}
}