1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-07-16 22:01:54 +03:00

Track the user's own typing state external to the composer

Fixes https://github.com/vector-im/riot-web/issues/9986

There's a few reasons for pushing this out to its own place:
* In future, we might want to move WhoIsTyping here.
* We have multiple composers now, and although they don't send typing notifications, they could (see https://github.com/vector-im/riot-web/issues/10188)
* In future we may have status for where/what the user is typing (https://github.com/matrix-org/matrix-doc/issues/437)
* The composer is complicated enough - it doesn't need to dedupe typing states too.

Note: This makes use of the principles introduced in https://github.com/vector-im/riot-web/issues/8923 and https://github.com/vector-im/riot-web/issues/9090
This commit is contained in:
Travis Ralston
2019-06-26 22:36:55 -06:00
parent 15d286ed93
commit cd089a3f95
3 changed files with 86 additions and 14 deletions

View File

@ -34,6 +34,7 @@ import PlatformPeg from "./PlatformPeg";
import { sendLoginRequest } from "./Login";
import * as StorageManager from './utils/StorageManager';
import SettingsStore from "./settings/SettingsStore";
import TypingStore from "./stores/TypingStore";
/**
* Called at startup, to attempt to build a logged-in Matrix session. It tries
@ -505,6 +506,7 @@ async function startMatrixClient() {
Notifier.start();
UserActivity.sharedInstance().start();
TypingStore.sharedInstance().reset(); // just in case
if (!SettingsStore.getValue("lowBandwidth")) {
Presence.start();
}
@ -553,6 +555,7 @@ function _clearStorage() {
export function stopMatrixClient() {
Notifier.stop();
UserActivity.sharedInstance().stop();
TypingStore.sharedInstance().reset();
Presence.stop();
ActiveWidgetStore.stop();
if (DMRoomMap.shared()) DMRoomMap.shared().stop();