Bring back the little green men without slowness

Introduces a singleton DMRoomMap that subscribes to account data to keep itself up to date so we don't have to keep doing the map inversion for each room tile.
This commit is contained in:
David Baker 2016-09-26 18:02:14 +01:00
parent 40ba1ff5aa
commit 690309adfc
3 changed files with 44 additions and 7 deletions

View file

@ -22,6 +22,7 @@ import Notifier from './Notifier'
import UserActivity from './UserActivity';
import Presence from './Presence';
import dis from './dispatcher';
import DMRoomMap from './utils/DMRoomMap';
/**
* Called at startup, to attempt to build a logged-in Matrix session. It tries
@ -317,6 +318,7 @@ export function startMatrixClient() {
Notifier.start();
UserActivity.start();
Presence.start();
DMRoomMap.shared().start();
MatrixClientPeg.start();
}
@ -354,6 +356,7 @@ export function stopMatrixClient() {
Notifier.stop();
UserActivity.stop();
Presence.stop();
DMRoomMap.shared().stop();
var cli = MatrixClientPeg.get();
if (cli) {
cli.stopClient();