mirror of https://github.com/vector-im/riot-web
Only calculate displayed groups if flair enabled
parent
b32e4a57bc
commit
204bbebfca
|
@ -105,12 +105,21 @@ export default React.createClass({
|
||||||
return <span />; // emote message must include the name so don't duplicate it
|
return <span />; // emote message must include the name so don't duplicate it
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let flair = <div />;
|
||||||
|
if (this.props.enableFlair) {
|
||||||
const displayedGroups = this._getDisplayedGroups(
|
const displayedGroups = this._getDisplayedGroups(
|
||||||
this.state.userGroups, this.state.relatedGroups,
|
this.state.userGroups, this.state.relatedGroups,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Backwards-compatible replacing of "(IRC)" with AS user flair
|
||||||
name = displayedGroups.length > 0 ? name.replace(' (IRC)', '') : name;
|
name = displayedGroups.length > 0 ? name.replace(' (IRC)', '') : name;
|
||||||
|
|
||||||
|
flair = <Flair key='flair'
|
||||||
|
userId={mxEvent.getSender()}
|
||||||
|
groups={displayedGroups}
|
||||||
|
/>;
|
||||||
|
}
|
||||||
|
|
||||||
const nameElem = <EmojiText key='name'>{ name || '' }</EmojiText>;
|
const nameElem = <EmojiText key='name'>{ name || '' }</EmojiText>;
|
||||||
|
|
||||||
// Name + flair
|
// Name + flair
|
||||||
|
@ -118,13 +127,7 @@ export default React.createClass({
|
||||||
<span className="mx_SenderProfile_name">
|
<span className="mx_SenderProfile_name">
|
||||||
{ nameElem }
|
{ nameElem }
|
||||||
</span>
|
</span>
|
||||||
{ this.props.enableFlair ?
|
{ flair }
|
||||||
<Flair key='flair'
|
|
||||||
userId={mxEvent.getSender()}
|
|
||||||
groups={displayedGroups}
|
|
||||||
/>
|
|
||||||
: null
|
|
||||||
}
|
|
||||||
</span>;
|
</span>;
|
||||||
|
|
||||||
const content = this.props.text ?
|
const content = this.props.text ?
|
||||||
|
|
Loading…
Reference in New Issue