Remove restriction on maybeMergeContacts, combineConversations fixes

This commit is contained in:
Scott Nonnenberg
2022-08-09 16:46:01 -07:00
committed by GitHub
parent 0fc5976117
commit 5d45197fe2
3 changed files with 129 additions and 74 deletions

View File

@@ -3,6 +3,7 @@
import type { MessageModel } from '../models/messages';
import * as durations from './durations';
import * as log from '../logging/log';
import { map, filter } from './iterables';
import { isNotNil } from './isNotNil';
import type { MessageAttributesType } from '../model-types.d';
@@ -121,6 +122,14 @@ export class MessageController {
return this.getById(id);
}
update(predicate: (message: MessageModel) => void): void {
const values = Object.values(this.messageLookup);
log.info(
`MessageController.update: About to process ${values.length} messages`
);
values.forEach(({ message }) => predicate(message));
}
_get(): LookupType {
return this.messageLookup;
}