implement currently_active

pull/21833/head
Matthew Hodgson 2016-03-16 22:44:54 +00:00
parent 58d46825ce
commit 500b88dc36
4 changed files with 5 additions and 1 deletions

View File

@ -88,6 +88,7 @@ module.exports = React.createClass({
<img className="mx_EntityTile_chevron" src="img/member_chevron.png" width="8" height="12"/>
<div className="mx_EntityTile_name_hover">{ this.props.name }</div>
<PresenceLabel activeAgo={this.props.presenceActiveAgo}
currentlyActive={this.props.presenceCurrentlyActive}
presenceState={this.props.presenceState} />
</div>
);

View File

@ -91,6 +91,7 @@ module.exports = React.createClass({
return (
<EntityTile {...this.props} presenceActiveAgo={active} presenceState={presenceState}
presenceCurrentlyActive={ member.user ? member.user.currentlyActive : false }
avatarJsx={av} title={this.getPowerLabel()} onClick={this.onClick}
shouldComponentUpdate={this.shouldComponentUpdate.bind(this)}
name={name} powerLevel={this.props.member.powerLevel} />

View File

@ -67,9 +67,10 @@ module.exports = React.createClass({
render: function() {
if (this.props.activeAgo >= 0) {
var ago = this.props.currentlyActive ? "now" : (this.getDuration(this.props.activeAgo) + " ago");
return (
<div className="mx_PresenceLabel">
{ this.getPrettyPresence(this.props.presenceState) } { this.getDuration(this.props.activeAgo) } ago
{ this.getPrettyPresence(this.props.presenceState) } { ago }
</div>
);
}

View File

@ -49,6 +49,7 @@ module.exports = React.createClass({
return (
<EntityTile {...this.props} presenceState={user.presence} presenceActiveAgo={active}
presenceCurrentlyActive={ user.currentlyActive }
name={name} title={user.userId} avatarJsx={avatarJsx} />
);
}