Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Move fields into consistent location for js-sdk to target
Browse files Browse the repository at this point in the history
  • Loading branch information
turt2live committed Sep 9, 2021
1 parent d9a0a0b commit 0cae60e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/sendTimePerformanceMetrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,10 @@ export function decorateStartSendingTime(content: object) {
export function sendRoundTripMetric(client: MatrixClient, inRoomId: string, forEventId: string) {
// noinspection JSIgnoredPromiseFromCall
client.sendEvent(inRoomId, 'io.element.performance_metric', {
// XXX: We stick all of this into `m.relates_to` so it doesn't end up encrypted.
"m.relates_to": {
rel_type: "io.element.metric",
event_id: forEventId,
"io.element.performance_metrics": {
forEventId: forEventId,
responseTs: Date.now(),
kind: 'send_time',
} as any, // override types because we're actually allowed to add extra metadata to relates_to
},
});
}

0 comments on commit 0cae60e

Please sign in to comment.