Convert KeyVerificationStateObserver to TS
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
0c6bf950f6
commit
aa10cf45a5
1 changed files with 2 additions and 2 deletions
|
@ -17,14 +17,14 @@ limitations under the License.
|
||||||
import { MatrixClientPeg } from '../MatrixClientPeg';
|
import { MatrixClientPeg } from '../MatrixClientPeg';
|
||||||
import { _t } from '../languageHandler';
|
import { _t } from '../languageHandler';
|
||||||
|
|
||||||
export function getNameForEventRoom(userId, roomId) {
|
export function getNameForEventRoom(userId: string, roomId: string): string {
|
||||||
const client = MatrixClientPeg.get();
|
const client = MatrixClientPeg.get();
|
||||||
const room = client.getRoom(roomId);
|
const room = client.getRoom(roomId);
|
||||||
const member = room && room.getMember(userId);
|
const member = room && room.getMember(userId);
|
||||||
return member ? member.name : userId;
|
return member ? member.name : userId;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function userLabelForEventRoom(userId, roomId) {
|
export function userLabelForEventRoom(userId: string, roomId: string): string {
|
||||||
const name = getNameForEventRoom(userId, roomId);
|
const name = getNameForEventRoom(userId, roomId);
|
||||||
if (name !== userId) {
|
if (name !== userId) {
|
||||||
return _t("%(name)s (%(userId)s)", { name, userId });
|
return _t("%(name)s (%(userId)s)", { name, userId });
|
Loading…
Reference in a new issue