You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-08-19 16:42:09 +03:00
Added a models directory. Added store, http-api and client files. Slowly transitioning to the architecture outlined in SYJS-5.
38 lines
777 B
JavaScript
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;
|