1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-12-05 17:02:07 +03:00

helper method to get sending status of event or replacement

This commit is contained in:
Bruno Windels
2019-05-16 14:40:39 +01:00
parent 266d0f9d05
commit 21c8c76dc3

View File

@@ -801,6 +801,18 @@ utils.extend(module.exports.MatrixEvent.prototype, {
this._replacingEvent = newEvent;
this.emit("Event.replaced", this);
}
},
/**
* Returns the status of the event, or the replacing event in case `makeReplace` has been called.
*
* @return {EventStatus}
*/
replacementOrOwnStatus() {
if (this._replacingEvent) {
return this._replacingEvent.status;
} else {
return this.status;
}
},