From 1adb63ac74b75ad5ec7622aa90d232006e9c3d6e Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 13 Oct 2017 20:18:55 -0600 Subject: [PATCH] Don't use MXIDs on the lightbox if possible Signed-off-by: Travis Ralston --- src/components/views/elements/ImageView.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/views/elements/ImageView.js b/src/components/views/elements/ImageView.js index e70a5d3b..bdb9d17f 100644 --- a/src/components/views/elements/ImageView.js +++ b/src/components/views/elements/ImageView.js @@ -150,8 +150,16 @@ module.exports = React.createClass({ var eventMeta; if(showEventMeta) { + // Figure out the sender, defaulting to mxid + let sender = this.props.mxEvent.getSender(); + const room = MatrixClientPeg.get().getRoom(this.props.mxEvent.getRoomId()); + if (room) { + const member = room.getMember(sender); + if (member) sender = member.name; + } + eventMeta = (
- { _t('Uploaded on %(date)s by %(user)s', {date: DateUtils.formatDate(new Date(this.props.mxEvent.getTs())), user: this.props.mxEvent.getSender()}) } + { _t('Uploaded on %(date)s by %(user)s', {date: DateUtils.formatDate(new Date(this.props.mxEvent.getTs())), user: sender}) }
); }