Merge branch 'main' into neilalexander/v065

This commit is contained in:
Neil Alexander 2022-03-03 18:28:28 +00:00
commit 51882d46b9
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
2 changed files with 8 additions and 1 deletions

View file

@ -286,7 +286,7 @@ func SetDisplayName(
return jsonerror.InternalServerError()
}
if err := api.SendEvents(req.Context(), rsAPI, api.KindNew, events, cfg.Matrix.ServerName, cfg.Matrix.ServerName, nil, false); err != nil {
if err := api.SendEvents(req.Context(), rsAPI, api.KindNew, events, cfg.Matrix.ServerName, cfg.Matrix.ServerName, nil, true); err != nil {
util.GetLogger(req.Context()).WithError(err).Error("SendEvents failed")
return jsonerror.InternalServerError()
}

View file

@ -17,6 +17,7 @@ package routing
import (
"database/sql"
"encoding/json"
"fmt"
"net/http"
"strconv"
@ -102,6 +103,12 @@ func Context(
id, requestedEvent, err := syncDB.SelectContextEvent(ctx, roomID, eventID)
if err != nil {
if err == sql.ErrNoRows {
return util.JSONResponse{
Code: http.StatusNotFound,
JSON: jsonerror.NotFound(fmt.Sprintf("Event %s not found", eventID)),
}
}
logrus.WithError(err).WithField("eventID", eventID).Error("unable to find requested event")
return jsonerror.InternalServerError()
}