Compare commits

...

2 Commits

Author SHA1 Message Date
bel
003ffb1231 bad matrix cert ok 2022-02-02 07:12:18 -07:00
bel
cdabce7a56 SH 2022-01-31 09:35:56 -07:00
2 changed files with 14 additions and 7 deletions

View File

@@ -128,9 +128,6 @@ func matrixrecv() error {
} }
if config.Get().Brokers.UseZips { if config.Get().Brokers.UseZips {
setNewZips(zips) setNewZips(zips)
} else {
sender.Send("I don't accept !zip, only !state right now")
} }
}() }()
func() { func() {
@@ -157,9 +154,6 @@ func matrixrecv() error {
} }
if !config.Get().Brokers.UseZips { if !config.Get().Brokers.UseZips {
setNewStates(states) setNewStates(states)
} else {
sender.Send("I don't accept !state, only !zip right now")
} }
}() }()
func() { func() {

View File

@@ -2,6 +2,7 @@ package message
import ( import (
"bytes" "bytes"
"crypto/tls"
"fmt" "fmt"
"io/ioutil" "io/ioutil"
"local/truckstop/config" "local/truckstop/config"
@@ -45,7 +46,19 @@ func newMatrix(conf config.Matrix, cont string) Matrix {
} }
func (m Matrix) getclient() (*gomatrix.Client, error) { func (m Matrix) getclient() (*gomatrix.Client, error) {
return gomatrix.NewClient(m.homeserver, m.username, m.token) client, err := gomatrix.NewClient(m.homeserver, m.username, m.token)
if err != nil {
return nil, err
}
client.Client = &http.Client{
Timeout: time.Minute,
Transport: &http.Transport{
TLSClientConfig: &tls.Config{
InsecureSkipVerify: true,
},
},
}
return client, nil
} }
func (m Matrix) Continuation() string { func (m Matrix) Continuation() string {