Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 3faf28f

Browse files
committed
Merge branch 'develop' of github.com:matrix-org/matrix-react-sdk into t3chguy/fix/11510
2 parents 38bf7b3 + f3958e4 commit 3faf28f

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/indexing/BaseEventIndexManager.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,13 @@ export default abstract class BaseEventIndexManager {
105105
/**
106106
* Initialize the event index for the given user.
107107
*
108+
* @param {string} userId The event that should be added to the index.
109+
* @param {string} deviceId The profile of the event sender at the
110+
*
108111
* @return {Promise} A promise that will resolve when the event index is
109112
* initialized.
110113
*/
111-
async initEventIndex(): Promise<void> {
114+
async initEventIndex(userId: string, deviceId: string): Promise<void> {
112115
throw new Error("Unimplemented");
113116
}
114117

src/indexing/EventIndexPeg.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ limitations under the License.
2121

2222
import PlatformPeg from "../PlatformPeg";
2323
import EventIndex from "../indexing/EventIndex";
24+
import {MatrixClientPeg} from "../MatrixClientPeg";
2425
import SettingsStore from '../settings/SettingsStore';
2526
import {SettingLevel} from "../settings/SettingLevel";
2627

@@ -70,9 +71,13 @@ class EventIndexPeg {
7071
async initEventIndex() {
7172
const index = new EventIndex();
7273
const indexManager = PlatformPeg.get().getEventIndexingManager();
74+
const client = MatrixClientPeg.get();
75+
76+
const userId = client.getUserId();
77+
const deviceId = client.getDeviceId();
7378

7479
try {
75-
await indexManager.initEventIndex();
80+
await indexManager.initEventIndex(userId, deviceId);
7681

7782
const userVersion = await indexManager.getUserVersion();
7883
const eventIndexIsEmpty = await indexManager.isEventIndexEmpty();
@@ -83,7 +88,7 @@ class EventIndexPeg {
8388
await indexManager.closeEventIndex();
8489
await this.deleteEventIndex();
8590

86-
await indexManager.initEventIndex();
91+
await indexManager.initEventIndex(userId, deviceId);
8792
await indexManager.setUserVersion(INDEX_VERSION);
8893
}
8994

0 commit comments

Comments
 (0)