Pass around MatrixClients instead of using MatrixClientPeg (#11000)

This commit is contained in:
Michael Telatynski
2023-05-30 10:36:34 +01:00
committed by GitHub
parent aa5a2e1363
commit 938aefc51c
28 changed files with 176 additions and 141 deletions
+2 -3
View File
@@ -17,15 +17,14 @@ limitations under the License.
import { Room } from "matrix-js-sdk/src/models/room";
import { RoomMember } from "matrix-js-sdk/src/models/room-member";
import { MatrixClientPeg } from "./MatrixClientPeg";
import { _t } from "./languageHandler";
export function usersTypingApartFromMeAndIgnored(room: Room): RoomMember[] {
return usersTyping(room, [MatrixClientPeg.get().getUserId()!].concat(MatrixClientPeg.get().getIgnoredUsers()));
return usersTyping(room, [room.client.getSafeUserId()].concat(room.client.getIgnoredUsers()));
}
export function usersTypingApartFromMe(room: Room): RoomMember[] {
return usersTyping(room, [MatrixClientPeg.get().getUserId()!]);
return usersTyping(room, [room.client.getSafeUserId()]);
}
/**