1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-08-19 16:42:09 +03:00
Files
matrix-js-sdk/lib/models/event.js
Kegan Dougal d1e51de7ec Split out matrix.js into different files. Glue things back.
Added a models directory. Added store, http-api and client files. Slowly
transitioning to the architecture outlined in SYJS-5.
2015-06-03 17:55:12 +01:00

38 lines
777 B
JavaScript

"use strict";
/*
* Construct a Matrix Event object
* @param {Object} event The raw event to be wrapped in this DAO
*/
function MatrixEvent(event) {
this.event = event || {};
}
MatrixEvent.prototype = {
getId: function() {
return this.event.event_id;
},
getSender: function() {
return this.event.user_id;
},
getType: function() {
return this.event.type;
},
getRoomId: function() {
return this.event.room_id;
},
getTs: function() {
return this.event.ts;
},
getContent: function() {
return this.event.content;
},
isState: function() {
return this.event.state_key !== undefined;
},
};
/**
* An event from Matrix.
*/
module.exports.MatrixEvent = MatrixEvent;