aboutsummaryrefslogtreecommitdiff
path: root/federationapi/storage
diff options
context:
space:
mode:
authorTill <2353100+S7evinK@users.noreply.github.com>2022-04-25 11:56:50 +0200
committerGitHub <noreply@github.com>2022-04-25 11:56:50 +0200
commit446819e4ac405393ae7834107adc5761afce8a34 (patch)
tree9440cc2298204bb3ba7d1924c756d0a0d61dab43 /federationapi/storage
parent67fb086c13b6845e6a76ab89d314895306e14e96 (diff)
Store the EDU type in the database (#2370)
Diffstat (limited to 'federationapi/storage')
-rw-r--r--federationapi/storage/interface.go2
-rw-r--r--federationapi/storage/shared/storage_edus.go3
2 files changed, 3 insertions, 2 deletions
diff --git a/federationapi/storage/interface.go b/federationapi/storage/interface.go
index 3fa8d1f7..e3038651 100644
--- a/federationapi/storage/interface.go
+++ b/federationapi/storage/interface.go
@@ -39,7 +39,7 @@ type Database interface {
GetPendingEDUs(ctx context.Context, serverName gomatrixserverlib.ServerName, limit int) (edus map[*shared.Receipt]*gomatrixserverlib.EDU, err error)
AssociatePDUWithDestination(ctx context.Context, transactionID gomatrixserverlib.TransactionID, serverName gomatrixserverlib.ServerName, receipt *shared.Receipt) error
- AssociateEDUWithDestination(ctx context.Context, serverName gomatrixserverlib.ServerName, receipt *shared.Receipt) error
+ AssociateEDUWithDestination(ctx context.Context, serverName gomatrixserverlib.ServerName, receipt *shared.Receipt, eduType string) error
CleanPDUs(ctx context.Context, serverName gomatrixserverlib.ServerName, receipts []*shared.Receipt) error
CleanEDUs(ctx context.Context, serverName gomatrixserverlib.ServerName, receipts []*shared.Receipt) error
diff --git a/federationapi/storage/shared/storage_edus.go b/federationapi/storage/shared/storage_edus.go
index 6e3c7e36..02a23338 100644
--- a/federationapi/storage/shared/storage_edus.go
+++ b/federationapi/storage/shared/storage_edus.go
@@ -31,12 +31,13 @@ func (d *Database) AssociateEDUWithDestination(
ctx context.Context,
serverName gomatrixserverlib.ServerName,
receipt *Receipt,
+ eduType string,
) error {
return d.Writer.Do(d.DB, nil, func(txn *sql.Tx) error {
if err := d.FederationQueueEDUs.InsertQueueEDU(
ctx, // context
txn, // SQL transaction
- "", // TODO: EDU type for coalescing
+ eduType, // EDU type for coalescing
serverName, // destination server name
receipt.nid, // NID from the federationapi_queue_json table
); err != nil {