Merge pull request #137 from Mikunj/fix/friend-display

Fix contact display
This commit is contained in:
Beaudan Campbell-Brown 2019-01-16 15:19:11 +11:00 committed by GitHub
commit 1b681bdc98
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 3 deletions

View file

@ -82,7 +82,7 @@
initialize() {
this.on('change:timestamp change:name change:number change:profileName', this.sort);
this.listenTo(conversations, 'add change:active_at', this.addActive);
this.listenTo(conversations, 'add change:active_at change:friendRequestStatus', this.addActive);
this.listenTo(conversations, 'reset', () => this.reset([]));
this.collator = new Intl.Collator();

View file

@ -2166,6 +2166,7 @@
messageSentAt: Date.now(),
title: i18n(title),
isFriendRequest: true,
friendRequestType: type,
});
},

View file

@ -100,8 +100,15 @@
const last = this.last().toJSON();
switch (userSetting) {
case SettingNames.COUNT:
title = 'Signal';
message = newMessageCountLabel;
title = 'Loki Messenger';
if (last.isFriendRequest) {
message = `Friend request ${last.friendRequestType}`;
} else if (messagesNotificationCount > 0) {
message = newMessageCountLabel;
} else {
return;
}
break;
case SettingNames.NAME: {
const lastMessageTitle = last.title;