Skip to content

Commit 3097463

Browse files
authored
Merge pull request matrix-org#3567 from matrix-org/t3chguy/room_create_ELS_use_profile
Fix Room Create ELS using MXID instead of newly set Displayname/Avatar
2 parents 2bdd279 + 3b8cb42 commit 3097463

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/components/structures/MessagePanel.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -443,15 +443,17 @@ module.exports = createReactClass({
443443
// one was itself. This way, the timestamp of the previous event === the
444444
// timestamp of the current event, and no DateSeparator is inserted.
445445
return this._getTilesForEvent(e, e, e === lastShownEvent);
446-
}).reduce((a, b) => a.concat(b));
446+
}).reduce((a, b) => a.concat(b), []);
447447

448+
// Get sender profile from the latest event in the summary as the m.room.create doesn't contain one
449+
const ev = this.props.events[i];
448450
ret.push(<EventListSummary
449451
key="roomcreationsummary"
450452
events={summarisedEvents}
451453
onToggle={this._onHeightChanged} // Update scroll state
452-
summaryMembers={[mxEv.sender]}
454+
summaryMembers={[ev.sender]}
453455
summaryText={_t("%(creator)s created and configured the room.", {
454-
creator: mxEv.sender ? mxEv.sender.name : mxEv.getSender(),
456+
creator: ev.sender ? ev.sender.name : ev.getSender(),
455457
})}
456458
>
457459
{ eventTiles }
@@ -529,7 +531,7 @@ module.exports = createReactClass({
529531
// one was itself. This way, the timestamp of the previous event === the
530532
// timestamp of the current event, and no DateSeparator is inserted.
531533
return this._getTilesForEvent(e, e, e === lastShownEvent);
532-
}).reduce((a, b) => a.concat(b));
534+
}).reduce((a, b) => a.concat(b), []);
533535

534536
if (eventTiles.length === 0) {
535537
eventTiles = null;

0 commit comments

Comments
 (0)