From b90e33b81b6fae54a37efafd5fdc391af11cfe08 Mon Sep 17 00:00:00 2001 From: Tomas Batalla Date: Tue, 19 Feb 2019 10:52:59 -0800 Subject: [PATCH] Fix off by one error for username colors The hash result would only have a range of 0..7, but the css of color variants is 1..8 --- src/components/views/messages/SenderProfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/messages/SenderProfile.js b/src/components/views/messages/SenderProfile.js index a8c52e06b1..0d47de4266 100644 --- a/src/components/views/messages/SenderProfile.js +++ b/src/components/views/messages/SenderProfile.js @@ -97,7 +97,7 @@ export default React.createClass({ render() { const EmojiText = sdk.getComponent('elements.EmojiText'); const {mxEvent} = this.props; - const colorNumber = hashCode(mxEvent.getSender()) % 8; + const colorNumber = (hashCode(mxEvent.getSender()) % 8) + 1; const name = mxEvent.sender ? mxEvent.sender.name : mxEvent.getSender(); const {msgtype} = mxEvent.getContent();