diff --git a/lib/shared/dm-ops/change-thread-read-status-spec.js b/lib/shared/dm-ops/change-thread-read-status-spec.js --- a/lib/shared/dm-ops/change-thread-read-status-spec.js +++ b/lib/shared/dm-ops/change-thread-read-status-spec.js @@ -38,23 +38,11 @@ const updateInfos = [ { - type: updateTypes.UPDATE_THREAD, + type: updateTypes.UPDATE_THREAD_READ_STATUS, id: uuid.v4(), time, - threadInfo: { - ...threadInfo, - currentUser: { - ...threadInfo.currentUser, - unread, - }, - timestamps: { - ...threadInfo.timestamps, - currentUser: { - ...threadInfo.timestamps.currentUser, - unread: time, - }, - }, - }, + threadID: threadInfo.id, + unread, }, ]; return { diff --git a/lib/shared/dm-ops/process-dm-ops.js b/lib/shared/dm-ops/process-dm-ops.js --- a/lib/shared/dm-ops/process-dm-ops.js +++ b/lib/shared/dm-ops/process-dm-ops.js @@ -288,41 +288,12 @@ // We aren't checking if the unread timestamp is lower than the time. // We're doing this because we want to flip the thread to unread after // any new message from a non-viewer. - const updatedThreadInfo = threadInfo.minimallyEncoded - ? { - ...threadInfo, - currentUser: { - ...threadInfo.currentUser, - unread: true, - }, - timestamps: { - ...threadInfo.timestamps, - currentUser: { - ...threadInfo.timestamps.currentUser, - unread: time, - }, - }, - } - : { - ...threadInfo, - currentUser: { - ...threadInfo.currentUser, - unread: true, - }, - timestamps: { - ...threadInfo.timestamps, - currentUser: { - ...threadInfo.timestamps.currentUser, - unread: time, - }, - }, - }; - updateInfos.push({ - type: updateTypes.UPDATE_THREAD, + type: updateTypes.UPDATE_THREAD_READ_STATUS, id: uuid.v4(), time, - threadInfo: updatedThreadInfo, + threadID: threadInfo.id, + unread: true, }); } diff --git a/lib/shared/updates/update-thread-read-status-spec.js b/lib/shared/updates/update-thread-read-status-spec.js --- a/lib/shared/updates/update-thread-read-status-spec.js +++ b/lib/shared/updates/update-thread-read-status-spec.js @@ -34,7 +34,22 @@ const storeThreadInfo = storeThreadInfos[update.threadID]; let updatedThread; - if (storeThreadInfo.minimallyEncoded) { + if (storeThreadInfo.thick) { + updatedThread = { + ...storeThreadInfo, + currentUser: { + ...storeThreadInfo.currentUser, + unread: update.unread, + }, + timestamps: { + ...storeThreadInfo.timestamps, + currentUser: { + ...storeThreadInfo.timestamps.currentUser, + unread: update.time, + }, + }, + }; + } else if (storeThreadInfo.minimallyEncoded) { updatedThread = { ...storeThreadInfo, currentUser: {