mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-15 18:13:09 -06:00
Refresh dendrite subtree - pull changes for appservice bug (#457)
Co-authored-by: Tak Wai Wong <tak@hntlabs.com>
This commit is contained in:
parent
6275dd0b25
commit
55341ef3cf
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -53,6 +53,7 @@ _testmain.go
|
||||||
|
|
||||||
# Default configuration file
|
# Default configuration file
|
||||||
dendrite.yaml
|
dendrite.yaml
|
||||||
|
zion-appservice.yaml
|
||||||
|
|
||||||
# Database files
|
# Database files
|
||||||
*.db
|
*.db
|
||||||
|
|
|
||||||
|
|
@ -173,13 +173,14 @@ func (s *OutputRoomEventConsumer) sendEvents(
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: We should probably be more intelligent and pick something not
|
// If the number of items in the array is different,
|
||||||
// in the control of the event. A NATS timestamp header or something maybe.
|
// then this should be treated as a different transaction. Incorporate the length
|
||||||
txnID := events[0].Event.OriginServerTS()
|
// of events into the transaction ID.
|
||||||
|
txnID := fmt.Sprintf("%d_%d", events[0].Event.OriginServerTS(), len(transaction))
|
||||||
|
|
||||||
// Send the transaction to the appservice.
|
// Send the transaction to the appservice.
|
||||||
// https://matrix.org/docs/spec/application_service/r0.1.2#put-matrix-app-v1-transactions-txnid
|
// https://matrix.org/docs/spec/application_service/r0.1.2#put-matrix-app-v1-transactions-txnid
|
||||||
address := fmt.Sprintf("%s/transactions/%d?access_token=%s", state.URL, txnID, url.QueryEscape(state.HSToken))
|
address := fmt.Sprintf("%s/transactions/%s?access_token=%s", state.URL, txnID, url.QueryEscape(state.HSToken))
|
||||||
req, err := http.NewRequestWithContext(ctx, "PUT", address, bytes.NewBuffer(transaction))
|
req, err := http.NewRequestWithContext(ctx, "PUT", address, bytes.NewBuffer(transaction))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue