diff --git a/lib/models/event.js b/lib/models/event.js index c78daf171..5a6a714ca 100644 --- a/lib/models/event.js +++ b/lib/models/event.js @@ -91,6 +91,15 @@ module.exports.MatrixEvent.prototype = { return this.event.content || {}; }, + /** + * Get the previous event content JSON. This will only return something for + * state events which exist in the timeline. + * @return {Object} The previous event content JSON, or an empty object. + */ + getPrevContent: function() { + return this.event.prev_content || {}; + }, + /** * Get the age of this event. This represents the age of the event when the * event arrived at the device, and not the age of the event when this