From 0b12e37459d2da0723d91ae30f2f398af79a8010 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Mon, 16 Aug 2021 09:01:38 +0100 Subject: [PATCH] Clarify usages of event's toJSON --- src/models/event.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/models/event.ts b/src/models/event.ts index 16383c9ae..2159c48ee 100644 --- a/src/models/event.ts +++ b/src/models/event.ts @@ -1235,10 +1235,15 @@ export class MatrixEvent extends EventEmitter { } /** - * Summarise the event as JSON for debugging. If encrypted, include both the - * decrypted and encrypted view of the event. This is named `toJSON` for use - * with `JSON.stringify` which checks objects for functions named `toJSON` - * and will call them to customise the output if they are defined. + * Summarise the event as JSON. This is currently used by React SDK's view + * event source feature and Seshat's event indexing, so take care when + * adjusting the output here. + * + * If encrypted, include both the decrypted and encrypted view of the event. + * + * This is named `toJSON` for use with `JSON.stringify` which checks objects + * for functions named `toJSON` and will call them to customise the output + * if they are defined. * * @return {Object} */