mirror of https://github.com/vector-im/riot-web
Merge remote-tracking branch 'origin/poljar/seshat-keytar' into develop
commit
f3958e43e7
|
@ -105,10 +105,13 @@ export default abstract class BaseEventIndexManager {
|
||||||
/**
|
/**
|
||||||
* Initialize the event index for the given user.
|
* Initialize the event index for the given user.
|
||||||
*
|
*
|
||||||
|
* @param {string} userId The event that should be added to the index.
|
||||||
|
* @param {string} deviceId The profile of the event sender at the
|
||||||
|
*
|
||||||
* @return {Promise} A promise that will resolve when the event index is
|
* @return {Promise} A promise that will resolve when the event index is
|
||||||
* initialized.
|
* initialized.
|
||||||
*/
|
*/
|
||||||
async initEventIndex(): Promise<void> {
|
async initEventIndex(userId: string, deviceId: string): Promise<void> {
|
||||||
throw new Error("Unimplemented");
|
throw new Error("Unimplemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@ limitations under the License.
|
||||||
|
|
||||||
import PlatformPeg from "../PlatformPeg";
|
import PlatformPeg from "../PlatformPeg";
|
||||||
import EventIndex from "../indexing/EventIndex";
|
import EventIndex from "../indexing/EventIndex";
|
||||||
|
import {MatrixClientPeg} from "../MatrixClientPeg";
|
||||||
import SettingsStore from '../settings/SettingsStore';
|
import SettingsStore from '../settings/SettingsStore';
|
||||||
import {SettingLevel} from "../settings/SettingLevel";
|
import {SettingLevel} from "../settings/SettingLevel";
|
||||||
|
|
||||||
|
@ -70,9 +71,13 @@ class EventIndexPeg {
|
||||||
async initEventIndex() {
|
async initEventIndex() {
|
||||||
const index = new EventIndex();
|
const index = new EventIndex();
|
||||||
const indexManager = PlatformPeg.get().getEventIndexingManager();
|
const indexManager = PlatformPeg.get().getEventIndexingManager();
|
||||||
|
const client = MatrixClientPeg.get();
|
||||||
|
|
||||||
|
const userId = client.getUserId();
|
||||||
|
const deviceId = client.getDeviceId();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await indexManager.initEventIndex();
|
await indexManager.initEventIndex(userId, deviceId);
|
||||||
|
|
||||||
const userVersion = await indexManager.getUserVersion();
|
const userVersion = await indexManager.getUserVersion();
|
||||||
const eventIndexIsEmpty = await indexManager.isEventIndexEmpty();
|
const eventIndexIsEmpty = await indexManager.isEventIndexEmpty();
|
||||||
|
@ -83,7 +88,7 @@ class EventIndexPeg {
|
||||||
await indexManager.closeEventIndex();
|
await indexManager.closeEventIndex();
|
||||||
await this.deleteEventIndex();
|
await this.deleteEventIndex();
|
||||||
|
|
||||||
await indexManager.initEventIndex();
|
await indexManager.initEventIndex(userId, deviceId);
|
||||||
await indexManager.setUserVersion(INDEX_VERSION);
|
await indexManager.setUserVersion(INDEX_VERSION);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue