Add support for syncing colors
// FREEBIE
This commit is contained in:
parent
141cdef2a4
commit
53f20640af
3 changed files with 11 additions and 7 deletions
|
@ -136,6 +136,7 @@
|
|||
name: contactDetails.name,
|
||||
id: contactDetails.number,
|
||||
avatar: contactDetails.avatar,
|
||||
color: contactDetails.color,
|
||||
type: 'private',
|
||||
active_at: Date.now()
|
||||
}).save();
|
||||
|
|
|
@ -355,7 +355,8 @@
|
|||
}
|
||||
|
||||
var title = this.get('name');
|
||||
var color;
|
||||
var color = this.get('color');
|
||||
if (!color) {
|
||||
if (this.isPrivate()) {
|
||||
if (title) {
|
||||
color = COLORS[Math.abs(this.hashCode()) % 15];
|
||||
|
@ -365,6 +366,7 @@
|
|||
} else {
|
||||
color = 'default';
|
||||
}
|
||||
}
|
||||
|
||||
if (this.avatarUrl) {
|
||||
return { url: this.avatarUrl, color: color };
|
||||
|
|
|
@ -109,4 +109,5 @@ message ContactDetails {
|
|||
optional string number = 1;
|
||||
optional string name = 2;
|
||||
optional Avatar avatar = 3;
|
||||
optional string color = 4;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue