mirror of https://github.com/vector-im/riot-web
Convert KeyVerificationStateObserver to TS
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>pull/21833/head
parent
0c6bf950f6
commit
aa10cf45a5
|
@ -17,14 +17,14 @@ limitations under the License.
|
|||
import { MatrixClientPeg } from '../MatrixClientPeg';
|
||||
import { _t } from '../languageHandler';
|
||||
|
||||
export function getNameForEventRoom(userId, roomId) {
|
||||
export function getNameForEventRoom(userId: string, roomId: string): string {
|
||||
const client = MatrixClientPeg.get();
|
||||
const room = client.getRoom(roomId);
|
||||
const member = room && room.getMember(userId);
|
||||
return member ? member.name : userId;
|
||||
}
|
||||
|
||||
export function userLabelForEventRoom(userId, roomId) {
|
||||
export function userLabelForEventRoom(userId: string, roomId: string): string {
|
||||
const name = getNameForEventRoom(userId, roomId);
|
||||
if (name !== userId) {
|
||||
return _t("%(name)s (%(userId)s)", { name, userId });
|
Loading…
Reference in New Issue