Mark conversation as unread

Co-authored-by: Sidney Keese <sidney@carbonfive.com>
This commit is contained in:
Chris Svenningsen 2020-10-28 15:54:32 -07:00 committed by Evan Hahn
parent 184f7e1bf3
commit c408072576
20 changed files with 169 additions and 62 deletions

View file

@ -113,6 +113,7 @@ export async function toContactRecord(
contactRecord.blocked = conversation.isBlocked();
contactRecord.whitelisted = Boolean(conversation.get('profileSharing'));
contactRecord.archived = Boolean(conversation.get('isArchived'));
contactRecord.markedUnread = Boolean(conversation.get('markedUnread'));
applyUnknownFields(contactRecord, conversation);
@ -137,6 +138,9 @@ export async function toAccountRecord(
}
accountRecord.avatarUrl = window.storage.get('avatarUrl') || '';
accountRecord.noteToSelfArchived = Boolean(conversation.get('isArchived'));
accountRecord.noteToSelfMarkedUnread = Boolean(
conversation.get('markedUnread')
);
accountRecord.readReceipts = Boolean(
window.storage.get('read-receipt-setting')
);
@ -218,6 +222,7 @@ export async function toGroupV1Record(
groupV1Record.blocked = conversation.isBlocked();
groupV1Record.whitelisted = Boolean(conversation.get('profileSharing'));
groupV1Record.archived = Boolean(conversation.get('isArchived'));
groupV1Record.markedUnread = Boolean(conversation.get('markedUnread'));
applyUnknownFields(groupV1Record, conversation);
@ -236,6 +241,7 @@ export async function toGroupV2Record(
groupV2Record.blocked = conversation.isBlocked();
groupV2Record.whitelisted = Boolean(conversation.get('profileSharing'));
groupV2Record.archived = Boolean(conversation.get('isArchived'));
groupV2Record.markedUnread = Boolean(conversation.get('markedUnread'));
applyUnknownFields(groupV2Record, conversation);
@ -386,6 +392,7 @@ export async function mergeGroupV1Record(
conversation.set({
isArchived: Boolean(groupV1Record.archived),
markedUnread: Boolean(groupV1Record.markedUnread),
storageID,
});
@ -446,6 +453,7 @@ export async function mergeGroupV2Record(
conversation.set({
isArchived: Boolean(groupV2Record.archived),
markedUnread: Boolean(groupV2Record.markedUnread),
storageID,
});
@ -537,6 +545,7 @@ export async function mergeContactRecord(
conversation.set({
isArchived: Boolean(contactRecord.archived),
markedUnread: Boolean(contactRecord.markedUnread),
storageID,
});
@ -559,6 +568,7 @@ export async function mergeAccountRecord(
avatarUrl,
linkPreviews,
noteToSelfArchived,
noteToSelfMarkedUnread,
pinnedConversations: remotelyPinnedConversationClasses,
profileKey,
readReceipts,
@ -734,6 +744,7 @@ export async function mergeAccountRecord(
conversation.set({
isArchived: Boolean(noteToSelfArchived),
markedUnread: Boolean(noteToSelfMarkedUnread),
storageID,
});