mirror of
https://github.com/element-hq/dendrite.git
synced 2025-09-14 05:12:26 +03:00
Use gmsl relay_txn response type
This commit is contained in:
parent
f98003c030
commit
7b3334778f
4 changed files with 12 additions and 18 deletions
|
@ -25,12 +25,6 @@ import (
|
|||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
type RelayTransactionResponse struct {
|
||||
Transaction gomatrixserverlib.Transaction `json:"transaction"`
|
||||
EntryID int64 `json:"entry_id,omitempty"`
|
||||
EntriesQueued bool `json:"entries_queued"`
|
||||
}
|
||||
|
||||
// GetTransactionFromRelay implements GET /_matrix/federation/v1/relay_txn/{userID}
|
||||
// This endpoint can be extracted into a separate relay server service.
|
||||
func GetTransactionFromRelay(
|
||||
|
@ -41,7 +35,7 @@ func GetTransactionFromRelay(
|
|||
) util.JSONResponse {
|
||||
logrus.Infof("Processing relay_txn for %s", userID.Raw())
|
||||
|
||||
previousEntry := gomatrixserverlib.RelayEntry{}
|
||||
var previousEntry gomatrixserverlib.RelayEntry
|
||||
if err := json.Unmarshal(fedReq.Content(), &previousEntry); err != nil {
|
||||
return util.JSONResponse{
|
||||
Code: http.StatusInternalServerError,
|
||||
|
@ -65,7 +59,7 @@ func GetTransactionFromRelay(
|
|||
|
||||
return util.JSONResponse{
|
||||
Code: http.StatusOK,
|
||||
JSON: RelayTransactionResponse{
|
||||
JSON: gomatrixserverlib.RespGetRelayTransaction{
|
||||
Transaction: response.Transaction,
|
||||
EntryID: response.EntryID,
|
||||
EntriesQueued: response.EntriesQueued,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue