This commit is contained in:
parent
65230f4fc2
commit
db46b615c3
@ -447,7 +447,7 @@ func check_matrix_federation(domain string) (version string, err error) {
|
|||||||
|
|
||||||
var federationTest matrix_result
|
var federationTest matrix_result
|
||||||
if err = json.NewDecoder(resp.Body).Decode(&federationTest); err != nil {
|
if err = json.NewDecoder(resp.Body).Decode(&federationTest); err != nil {
|
||||||
log.Printf("Error in check_matrix_federation, when decoding json: %w", err.Error())
|
log.Printf("Error in check_matrix_federation, when decoding json: %s", err.Error())
|
||||||
return "", fmt.Errorf("Sorry, the federation tester is broken. Check on https://federationtester.matrix.org/#%s", strings.TrimSuffix(domain, "."))
|
return "", fmt.Errorf("Sorry, the federation tester is broken. Check on https://federationtester.matrix.org/#%s", strings.TrimSuffix(domain, "."))
|
||||||
} else if federationTest.FederationOK {
|
} else if federationTest.FederationOK {
|
||||||
version = federationTest.Version.Name + " " + federationTest.Version.Version
|
version = federationTest.Version.Name + " " + federationTest.Version.Version
|
||||||
@ -499,7 +499,7 @@ func check_matrix_client(domain string) (version string, err error) {
|
|||||||
if resp.StatusCode < 300 {
|
if resp.StatusCode < 300 {
|
||||||
var wellknown matrix_wk_client
|
var wellknown matrix_wk_client
|
||||||
if err = json.NewDecoder(resp.Body).Decode(&wellknown); err != nil {
|
if err = json.NewDecoder(resp.Body).Decode(&wellknown); err != nil {
|
||||||
log.Printf("Error in check_matrix_client, when decoding json: %w", err.Error())
|
log.Printf("Error in check_matrix_client, when decoding json: %s", err.Error())
|
||||||
return "", fmt.Errorf("File at https://%s/.well-known/matrix/client is invalid: JSON parse error", strings.TrimSuffix(domain, "."))
|
return "", fmt.Errorf("File at https://%s/.well-known/matrix/client is invalid: JSON parse error", strings.TrimSuffix(domain, "."))
|
||||||
} else if wellknown.Homeserver.BaseURL != "" {
|
} else if wellknown.Homeserver.BaseURL != "" {
|
||||||
if baseurl, err := url.Parse(wellknown.Homeserver.BaseURL); err != nil {
|
if baseurl, err := url.Parse(wellknown.Homeserver.BaseURL); err != nil {
|
||||||
@ -528,7 +528,7 @@ func check_matrix_client(domain string) (version string, err error) {
|
|||||||
|
|
||||||
var clientTest matrix_client_versions
|
var clientTest matrix_client_versions
|
||||||
if err = json.NewDecoder(resp2.Body).Decode(&clientTest); err != nil {
|
if err = json.NewDecoder(resp2.Body).Decode(&clientTest); err != nil {
|
||||||
log.Printf("Error in check_matrix_client, when decoding versions json: %w", err.Error())
|
log.Printf("Error in check_matrix_client, when decoding versions json: %s", err.Error())
|
||||||
return "", fmt.Errorf("File at %s/_matrix/client/versions is invalid: JSON parse error: %s", HomeserverBase, err.Error())
|
return "", fmt.Errorf("File at %s/_matrix/client/versions is invalid: JSON parse error: %s", HomeserverBase, err.Error())
|
||||||
} else if len(clientTest.Versions) == 0 {
|
} else if len(clientTest.Versions) == 0 {
|
||||||
return "", fmt.Errorf("File at %s/_matrix/client/versions is invalid: no protocol version supported", HomeserverBase)
|
return "", fmt.Errorf("File at %s/_matrix/client/versions is invalid: no protocol version supported", HomeserverBase)
|
||||||
|
@ -37,7 +37,7 @@ func main() {
|
|||||||
// Check one or more students and exit
|
// Check one or more students and exit
|
||||||
for _, std_login := range flag.Args() {
|
for _, std_login := range flag.Args() {
|
||||||
if verbose {
|
if verbose {
|
||||||
log.Println("==============================\n")
|
log.Printf("==============================\n\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
if std, err := adlin.GetStudentByLogin(std_login); err != nil {
|
if std, err := adlin.GetStudentByLogin(std_login); err != nil {
|
||||||
|
Reference in New Issue
Block a user