You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2026-01-03 23:22:30 +03:00
Add filter integration tests; more bug fixes.
This commit is contained in:
@@ -17,6 +17,11 @@ module.exports.MatrixInMemoryStore = function MatrixInMemoryStore() {
|
||||
// userId: User
|
||||
};
|
||||
this.syncToken = null;
|
||||
this.filters = {
|
||||
// userId: {
|
||||
// filterId: Filter
|
||||
// }
|
||||
};
|
||||
};
|
||||
|
||||
module.exports.MatrixInMemoryStore.prototype = {
|
||||
@@ -116,6 +121,11 @@ module.exports.MatrixInMemoryStore.prototype = {
|
||||
* @param {Filter} filter
|
||||
*/
|
||||
storeFilter: function(filter) {
|
||||
if (!filter) { return; }
|
||||
if (!this.filters[filter.userId]) {
|
||||
this.filters[filter.userId] = {};
|
||||
}
|
||||
this.filters[filter.userId][filter.filterId] = filter;
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -125,7 +135,10 @@ module.exports.MatrixInMemoryStore.prototype = {
|
||||
* @return {?Filter} A filter or null.
|
||||
*/
|
||||
getFilter: function(userId, filterId) {
|
||||
return null;
|
||||
if (!this.filters[userId] || !this.filters[userId][filterId]) {
|
||||
return null;
|
||||
}
|
||||
return this.filters[userId][filterId];
|
||||
}
|
||||
|
||||
// TODO
|
||||
|
||||
Reference in New Issue
Block a user