Use new gmsl RelayEvents type for send_relay request body

This commit is contained in:
Devon Hudson 2023-01-31 12:32:36 -07:00
parent 7b3334778f
commit b935da6c33
No known key found for this signature in database
GPG Key ID: CD06B18E77F6A628

View File

@ -36,11 +36,7 @@ func SendTransactionToRelay(
) util.JSONResponse { ) util.JSONResponse {
logrus.Infof("Processing send_relay for %s", userID.Raw()) logrus.Infof("Processing send_relay for %s", userID.Raw())
var txnEvents struct { var txnEvents gomatrixserverlib.RelayEvents
PDUs []json.RawMessage `json:"pdus"`
EDUs []gomatrixserverlib.EDU `json:"edus"`
}
if err := json.Unmarshal(fedReq.Content(), &txnEvents); err != nil { if err := json.Unmarshal(fedReq.Content(), &txnEvents); err != nil {
logrus.Info("The request body could not be decoded into valid JSON." + err.Error()) logrus.Info("The request body could not be decoded into valid JSON." + err.Error())
return util.JSONResponse{ return util.JSONResponse{