Don't use MXIDs on the lightbox if possible

Signed-off-by: Travis Ralston <travpc@gmail.com>
pull/5281/head
Travis Ralston 2017-10-13 20:18:55 -06:00
parent d1476e0cc7
commit 1adb63ac74
1 changed files with 9 additions and 1 deletions

View File

@ -150,8 +150,16 @@ module.exports = React.createClass({
var eventMeta; var eventMeta;
if(showEventMeta) { 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 = (<div className="mx_ImageView_metadata"> eventMeta = (<div className="mx_ImageView_metadata">
{ _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}) }
</div>); </div>);
} }