mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2025-01-09 11:55:37 +01:00
return decrypted type and content
This commit is contained in:
parent
7bfcfc9eed
commit
a817a9aaf9
@ -22,7 +22,7 @@ export class EventEntry extends BaseEntry {
|
|||||||
super(fragmentIdComparer);
|
super(fragmentIdComparer);
|
||||||
this._eventEntry = eventEntry;
|
this._eventEntry = eventEntry;
|
||||||
this._decryptionError = null;
|
this._decryptionError = null;
|
||||||
this._isEncrypted = false;
|
this._decryptedEvent = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
get event() {
|
get event() {
|
||||||
@ -38,7 +38,7 @@ export class EventEntry extends BaseEntry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get content() {
|
get content() {
|
||||||
return this._eventEntry.event.content;
|
return this._decryptedEvent?.content || this._eventEntry.event.content;
|
||||||
}
|
}
|
||||||
|
|
||||||
get prevContent() {
|
get prevContent() {
|
||||||
@ -46,7 +46,7 @@ export class EventEntry extends BaseEntry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get eventType() {
|
get eventType() {
|
||||||
return this._eventEntry.event.type;
|
return this._decryptedEvent?.type || this._eventEntry.event.type;
|
||||||
}
|
}
|
||||||
|
|
||||||
get stateKey() {
|
get stateKey() {
|
||||||
@ -74,8 +74,7 @@ export class EventEntry extends BaseEntry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
replaceWithDecrypted(event) {
|
replaceWithDecrypted(event) {
|
||||||
this._eventEntry.event = event;
|
this._decryptedEvent = event;
|
||||||
this._isEncrypted = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setDecryptionError(err) {
|
setDecryptionError(err) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user