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

based on PR review, rewrite account_data support to avoid tracking the section that events came from, and instead having /sync results piped into the right bit of the room directly

This commit is contained in:
Matthew Hodgson
2016-01-11 19:25:44 +00:00
parent db5ca49ee2
commit 88c7293838
3 changed files with 30 additions and 43 deletions

View File

@@ -53,9 +53,6 @@ module.exports.EventStatus = {
* @prop {boolean} forwardLooking True if this event is 'forward looking', meaning
* that getDirectionalContent() will return event.content and not event.prev_content.
* Default: true. <strong>This property is experimental and may change.</strong>
* @prop {String} section The type of /sync section this event came from, if any
* one of 'state', 'account_data', 'ephemeral', or 'timeline'. Useful for recognising
* 'account_data' events.
*/
module.exports.MatrixEvent = function MatrixEvent(event, encrypted) {
this.event = event || {};
@@ -64,7 +61,6 @@ module.exports.MatrixEvent = function MatrixEvent(event, encrypted) {
this.status = null;
this.forwardLooking = true;
this.encrypted = Boolean(encrypted);
this.section = null;
};
module.exports.MatrixEvent.prototype = {
@@ -182,14 +178,6 @@ module.exports.MatrixEvent.prototype = {
return this.event.state_key !== undefined;
},
/**
* Check if this event is account_data.
* @return {boolean} True if this event describes account_data
*/
isAccountData: function() {
return this.section === "account_data";
},
/**
* Check if the event is encrypted.
* @return {boolean} True if this event is encrypted.