From 4b96e01410bebeb883bf393004468bd81d7868c9 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 2 Aug 2018 09:49:54 +0200 Subject: [PATCH 1/4] enable newly introduced option --- src/MatrixClientPeg.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/MatrixClientPeg.js b/src/MatrixClientPeg.js index 82d18d307d..e8ef689294 100644 --- a/src/MatrixClientPeg.js +++ b/src/MatrixClientPeg.js @@ -108,6 +108,7 @@ class MatrixClientPeg { opts.pendingEventOrdering = "detached"; if (SettingsStore.isFeatureEnabled('feature_lazyloading')) { + opts.lazyLoadMembers = true; opts.filter = await this.matrixClient.createFilter(FILTER_CONTENT); } From e1843601becdeaa89eef2a264c1b027c648bd65a Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 2 Aug 2018 17:09:18 +0200 Subject: [PATCH 2/4] support directional content in pill member fake --- src/components/views/elements/Pill.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/views/elements/Pill.js b/src/components/views/elements/Pill.js index f3b6d4e32a..38847a3584 100644 --- a/src/components/views/elements/Pill.js +++ b/src/components/views/elements/Pill.js @@ -187,6 +187,9 @@ const Pill = React.createClass({ getContent: () => { return {avatar_url: resp.avatar_url}; }, + getDirectionalContent: function() { + return this.getContent(); + } }; this.setState({member}); }).catch((err) => { From 42fc83d2a84ddd3ce7919b37627cda1b9ea6117f Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 2 Aug 2018 19:38:41 +0200 Subject: [PATCH 3/4] Move LL filter creation inside MatrixClient As we need an option to turn lazy loading on (we can't just accept a filter, as /messages has an incompatible filter), better only pass the option and create the filter inside startClient --- src/MatrixClientPeg.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/MatrixClientPeg.js b/src/MatrixClientPeg.js index e8ef689294..f5872812de 100644 --- a/src/MatrixClientPeg.js +++ b/src/MatrixClientPeg.js @@ -34,14 +34,6 @@ interface MatrixClientCreds { guest: boolean, } -const FILTER_CONTENT = { - room: { - state: { - lazy_load_members: true, - }, - }, -}; - /** * Wrapper object for handling the js-sdk Matrix Client object in the react-sdk * Handles the creation/initialisation of client objects. @@ -109,7 +101,6 @@ class MatrixClientPeg { if (SettingsStore.isFeatureEnabled('feature_lazyloading')) { opts.lazyLoadMembers = true; - opts.filter = await this.matrixClient.createFilter(FILTER_CONTENT); } try { @@ -128,7 +119,7 @@ class MatrixClientPeg { MatrixActionCreators.start(this.matrixClient); console.log(`MatrixClientPeg: really starting MatrixClient`); - this.get().startClient(opts); + await this.get().startClient(opts); console.log(`MatrixClientPeg: MatrixClient started`); } From f1643f77ac44ba24e9b6654c4d45fb2a14f984ce Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 2 Aug 2018 19:57:20 +0200 Subject: [PATCH 4/4] fix lint --- src/components/views/elements/Pill.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/elements/Pill.js b/src/components/views/elements/Pill.js index 38847a3584..e06ed5a22f 100644 --- a/src/components/views/elements/Pill.js +++ b/src/components/views/elements/Pill.js @@ -189,7 +189,7 @@ const Pill = React.createClass({ }, getDirectionalContent: function() { return this.getContent(); - } + }, }; this.setState({member}); }).catch((err) => {