Add text for room avatar events and skip empty text events

This commit is contained in:
Jaiwanth 2021-06-22 12:50:15 +05:30
parent 12ecaf30df
commit db875508d8
4 changed files with 20 additions and 5 deletions

View file

@ -140,8 +140,11 @@ export default abstract class Exporter {
return fileDirectory + "/" + fileName + '-' + fileDate + fileExt;
}
protected isReply(mxEvent) {
const relatesTo = mxEvent.getContent()["m.relates_to"];
protected isReply(event: MatrixEvent) {
const isEncrypted = event.isEncrypted();
// If encrypted, in_reply_to lies in event.event.content
const content = isEncrypted ? event.event.content : event.getContent();
const relatesTo = content["m.relates_to"];
return !!(relatesTo && relatesTo["m.in_reply_to"]);
}