Use new gmsl to use new String() API

This commit is contained in:
Devon Hudson 2023-04-28 13:31:21 -06:00
parent 9e9617ff84
commit b00e272e6f
No known key found for this signature in database
GPG key ID: CD06B18E77F6A628
7 changed files with 11 additions and 13 deletions

View file

@ -101,11 +101,11 @@ func (r *RelayInternalAPI) QueryTransactions(
userID spec.UserID,
previousEntry fclient.RelayEntry,
) (api.QueryRelayTransactionsResponse, error) {
logrus.Infof("QueryTransactions for %s", userID.Raw())
logrus.Infof("QueryTransactions for %s", userID.String())
if previousEntry.EntryID > 0 {
logrus.Infof("Cleaning previous entry (%v) from db for %s",
previousEntry.EntryID,
userID.Raw(),
userID.String(),
)
prevReceipt := receipt.NewReceipt(previousEntry.EntryID)
err := r.db.CleanTransactions(ctx, userID, []*receipt.Receipt{&prevReceipt})
@ -123,12 +123,12 @@ func (r *RelayInternalAPI) QueryTransactions(
response := api.QueryRelayTransactionsResponse{}
if transaction != nil && receipt != nil {
logrus.Infof("Obtained transaction (%v) for %s", transaction.TransactionID, userID.Raw())
logrus.Infof("Obtained transaction (%v) for %s", transaction.TransactionID, userID.String())
response.Transaction = *transaction
response.EntryID = receipt.GetNID()
response.EntriesQueued = true
} else {
logrus.Infof("No more entries in the queue for %s", userID.Raw())
logrus.Infof("No more entries in the queue for %s", userID.String())
response.EntryID = 0
response.EntriesQueued = false
}

View file

@ -34,7 +34,7 @@ func GetTransactionFromRelay(
relayAPI api.RelayInternalAPI,
userID spec.UserID,
) util.JSONResponse {
logrus.Infof("Processing relay_txn for %s", userID.Raw())
logrus.Infof("Processing relay_txn for %s", userID.String())
var previousEntry fclient.RelayEntry
if err := json.Unmarshal(fedReq.Content(), &previousEntry); err != nil {

View file

@ -35,7 +35,7 @@ func createQuery(
prevEntry fclient.RelayEntry,
) fclient.FederationRequest {
var federationPathPrefixV1 = "/_matrix/federation/v1"
path := federationPathPrefixV1 + "/relay_txn/" + userID.Raw()
path := federationPathPrefixV1 + "/relay_txn/" + userID.String()
request := fclient.NewFederationRequest("GET", userID.Domain(), "relay", path)
request.SetContent(prevEntry)

View file

@ -36,7 +36,7 @@ func SendTransactionToRelay(
txnID gomatrixserverlib.TransactionID,
userID spec.UserID,
) util.JSONResponse {
logrus.Infof("Processing send_relay for %s", userID.Raw())
logrus.Infof("Processing send_relay for %s", userID.String())
var txnEvents fclient.RelayEvents
if err := json.Unmarshal(fedReq.Content(), &txnEvents); err != nil {

View file

@ -52,7 +52,7 @@ func createFederationRequest(
content interface{},
) fclient.FederationRequest {
var federationPathPrefixV1 = "/_matrix/federation/v1"
path := federationPathPrefixV1 + "/send_relay/" + string(txnID) + "/" + userID.Raw()
path := federationPathPrefixV1 + "/send_relay/" + string(txnID) + "/" + userID.String()
request := fclient.NewFederationRequest("PUT", origin, destination, path)
request.SetContent(content)