[IMP] mail: remove 'MessageSeenIndicator' recompute methods
Task-2806655 closes odoo/odoo#87352 Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
},
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user