From f0fbdd3a066bef0393113fe3a45d74580482a0f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20K=C3=BChn?= Date: Mon, 28 Mar 2022 12:08:14 +0000 Subject: [PATCH] [IMP] mail: remove 'MessageSeenIndicator' recompute methods MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-2806655 closes odoo/odoo#87352 Signed-off-by: Sébastien Theys (seb) --- .../src/models/message_seen_indicator.js | 34 ------------------- .../models/messaging_notification_handler.js | 4 --- 2 files changed, 38 deletions(-) diff --git a/addons/mail/static/src/models/message_seen_indicator.js b/addons/mail/static/src/models/message_seen_indicator.js index bbf582c9874..5fa99032462 100644 --- a/addons/mail/static/src/models/message_seen_indicator.js +++ b/addons/mail/static/src/models/message_seen_indicator.js @@ -7,40 +7,6 @@ import { replace, unlinkAll } from '@mail/model/model_field_command'; registerModel({ name: 'MessageSeenIndicator', identifyingFields: ['thread', 'message'], - modelMethods: { - /** - * @param {Thread} [channel] the concerned thread - */ - recomputeFetchedValues(channel = undefined) { - const indicatorFindFunction = channel ? localIndicator => localIndicator.thread === channel : undefined; - const indicators = this.messaging.models['MessageSeenIndicator'].all(indicatorFindFunction); - for (const indicator of indicators) { - indicator.update({ - hasEveryoneFetched: indicator._computeHasEveryoneFetched(), - hasSomeoneFetched: indicator._computeHasSomeoneFetched(), - partnersThatHaveFetched: indicator._computePartnersThatHaveFetched(), - }); - } - }, - /** - * @param {Thread} [channel] the concerned thread - */ - recomputeSeenValues(channel = undefined) { - const indicatorFindFunction = channel ? localIndicator => localIndicator.thread === channel : undefined; - const indicators = this.messaging.models['MessageSeenIndicator'].all(indicatorFindFunction); - for (const indicator of indicators) { - indicator.update({ - hasEveryoneSeen: indicator._computeHasEveryoneSeen(), - hasSomeoneFetched: indicator._computeHasSomeoneFetched(), - hasSomeoneSeen: indicator._computeHasSomeoneSeen(), - isMessagePreviousToLastCurrentPartnerMessageSeenByEveryone: - indicator._computeIsMessagePreviousToLastCurrentPartnerMessageSeenByEveryone(), - partnersThatHaveFetched: indicator._computePartnersThatHaveFetched(), - partnersThatHaveSeen: indicator._computePartnersThatHaveSeen(), - }); - } - }, - }, recordMethods: { /** * Manually called as not always called when necessary diff --git a/addons/mail/static/src/models/messaging_notification_handler.js b/addons/mail/static/src/models/messaging_notification_handler.js index a799d9d276b..9309ecd5fa3 100644 --- a/addons/mail/static/src/models/messaging_notification_handler.js +++ b/addons/mail/static/src/models/messaging_notification_handler.js @@ -177,8 +177,6 @@ registerModel({ message: insertAndReplace({ id: last_message_id }), thread: replace(channel), }); - // FIXME force the computing of message values (cf task-2261221) - this.messaging.models['MessageSeenIndicator'].recomputeFetchedValues(channel); }, /** * @private @@ -328,8 +326,6 @@ registerModel({ if (shouldComputeSeenIndicators) { // FIXME force the computing of thread values (cf task-2261221) this.messaging.models['Thread'].computeLastCurrentPartnerMessageSeenByEveryone(channel); - // FIXME force the computing of message values (cf task-2261221) - this.messaging.models['MessageSeenIndicator'].recomputeSeenValues(channel); } }, /**