1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-07 10:46:24 +03:00

add verification request tile + styling

This commit is contained in:
Bruno Windels
2019-11-07 17:39:50 +01:00
parent 5c9e80a0ba
commit 0d2f9c4215
6 changed files with 279 additions and 0 deletions

View File

@@ -151,3 +151,20 @@ export default class KeyVerificationStateObserver {
this.otherPartyUserId = fromUserId === this._client.getUserId() ? toUserId : fromUserId;
}
}
export function getNameForEventRoom(userId, mxEvent) {
const roomId = mxEvent.getRoomId();
const client = MatrixClientPeg.get();
const room = client.getRoom(roomId);
const member = room.getMember(userId);
return member ? member.name : userId;
}
export function userLabelForEventRoom(userId, mxEvent) {
const name = getNameForEventRoom(userId, mxEvent);
if (name !== userId) {
return _t("%(name)s (%(userId)s)", {name, userId});
} else {
return userId;
}
}