Skip to content

Commit 57ba816

Browse files
committed
Highlight messages using new push rules support in js sdk
1 parent 9aa9a60 commit 57ba816

3 files changed

Lines changed: 13 additions & 1 deletion

File tree

‎skins/base/css/molecules/MessageTile.css‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,7 @@ limitations under the License.
2424
.mx_MessageTile.not_sent {
2525
color: #f11;
2626
}
27+
28+
.mx_MessageTile.highlight {
29+
color: #00f;
30+
}

‎skins/base/views/molecules/MessageTile.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ module.exports = React.createClass({
4949
var classes = classNames({
5050
mx_MessageTile: true,
5151
sending: this.props.mxEvent.status == 'sending',
52-
not_sent: this.props.mxEvent.status == 'not_sent'
52+
not_sent: this.props.mxEvent.status == 'not_sent',
53+
highlight: this.shouldHighlight()
5354
});
5455
return (
5556
<div className={classes}>

‎src/controllers/molecules/MessageTile.js‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ limitations under the License.
1616

1717
'use strict';
1818

19+
var MatrixClientPeg = require("../../MatrixClientPeg");
20+
1921
module.exports = {
22+
shouldHighlight: function() {
23+
var actions = this.props.mxEvent.getPushActions(MatrixClientPeg.get());
24+
if (!actions || !actions.tweaks) { return false; }
25+
return actions.tweaks.highlight;
26+
}
2027
};
2128

0 commit comments

Comments
 (0)