don't use removed .event property anymore on verification request
This commit is contained in:
parent
50b05551ba
commit
2483337e89
4 changed files with 25 additions and 27 deletions
|
@ -17,16 +17,15 @@ limitations under the License.
|
|||
import {MatrixClientPeg} from '../MatrixClientPeg';
|
||||
import { _t } from '../languageHandler';
|
||||
|
||||
export function getNameForEventRoom(userId, mxEvent) {
|
||||
const roomId = mxEvent.getRoomId();
|
||||
export function getNameForEventRoom(userId, roomId) {
|
||||
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);
|
||||
export function userLabelForEventRoom(userId, roomId) {
|
||||
const name = getNameForEventRoom(userId, roomId);
|
||||
if (name !== userId) {
|
||||
return _t("%(name)s (%(userId)s)", {name, userId});
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue