Merge pull request #2664 from tebatalla/patch-1

Fix off by one error for username colors
This commit is contained in:
Bruno Windels 2019-02-20 08:42:28 +01:00 committed by GitHub
commit 338eafab2b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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();