diff --git a/js/background.js b/js/background.js index 50f9292289d..1417822e719 100644 --- a/js/background.js +++ b/js/background.js @@ -136,6 +136,7 @@ name: contactDetails.name, id: contactDetails.number, avatar: contactDetails.avatar, + color: contactDetails.color, type: 'private', active_at: Date.now() }).save(); diff --git a/js/models/conversations.js b/js/models/conversations.js index 97acd0fd797..acac1436234 100644 --- a/js/models/conversations.js +++ b/js/models/conversations.js @@ -355,15 +355,17 @@ } var title = this.get('name'); - var color; - if (this.isPrivate()) { - if (title) { - color = COLORS[Math.abs(this.hashCode()) % 15]; + var color = this.get('color'); + if (!color) { + if (this.isPrivate()) { + if (title) { + color = COLORS[Math.abs(this.hashCode()) % 15]; + } else { + color = 'grey'; + } } else { - color = 'grey'; + color = 'default'; } - } else { - color = 'default'; } if (this.avatarUrl) { diff --git a/protos/IncomingPushMessageSignal.proto b/protos/IncomingPushMessageSignal.proto index d21b760cf15..9c780bbca47 100644 --- a/protos/IncomingPushMessageSignal.proto +++ b/protos/IncomingPushMessageSignal.proto @@ -109,4 +109,5 @@ message ContactDetails { optional string number = 1; optional string name = 2; optional Avatar avatar = 3; + optional string color = 4; }