cleanup
This commit is contained in:
parent
baad4bd37f
commit
dc0576f2db
2 changed files with 3 additions and 5 deletions
|
@ -115,7 +115,7 @@ export class Decryption {
|
|||
try {
|
||||
payload = JSON.parse(plaintext);
|
||||
} catch (err) {
|
||||
throw new DecryptionError("NOT_JSON", event, {plaintext, err});
|
||||
throw new DecryptionError("PLAINTEXT_NOT_JSON", event, {plaintext, err});
|
||||
}
|
||||
this._validatePayload(payload, event);
|
||||
return {event: payload, senderKey};
|
||||
|
|
|
@ -22,6 +22,7 @@ export class EventEntry extends BaseEntry {
|
|||
super(fragmentIdComparer);
|
||||
this._eventEntry = eventEntry;
|
||||
this._decryptionError = null;
|
||||
this._isEncrypted = false;
|
||||
}
|
||||
|
||||
get fragmentId() {
|
||||
|
@ -32,10 +33,6 @@ export class EventEntry extends BaseEntry {
|
|||
return this._eventEntry.eventIndex;
|
||||
}
|
||||
|
||||
get internalId() {
|
||||
return `${this.fragmentId}|${this.entryIndex}`;
|
||||
}
|
||||
|
||||
get content() {
|
||||
return this._eventEntry.event.content;
|
||||
}
|
||||
|
@ -74,6 +71,7 @@ export class EventEntry extends BaseEntry {
|
|||
|
||||
replaceWithDecrypted(event) {
|
||||
this._eventEntry.event = event;
|
||||
this._isEncrypted = true;
|
||||
}
|
||||
|
||||
setDecryptionError(err) {
|
||||
|
|
Reference in a new issue