Early preparations for PNP Contact Merging
This commit is contained in:
parent
2f5dd73e58
commit
faf6c41332
30 changed files with 1572 additions and 447 deletions
|
@ -44,11 +44,11 @@ export class Reactions extends Collection<ReactionModel> {
|
|||
const senderId = getContactId(message.attributes);
|
||||
const sentAt = message.get('sent_at');
|
||||
const reactionsBySource = this.filter(re => {
|
||||
const targetSenderId = window.ConversationController.ensureContactIds({
|
||||
const targetSender = window.ConversationController.lookupOrCreate({
|
||||
uuid: re.get('targetAuthorUuid'),
|
||||
});
|
||||
const targetTimestamp = re.get('targetTimestamp');
|
||||
return targetSenderId === senderId && targetTimestamp === sentAt;
|
||||
return targetSender?.id === senderId && targetTimestamp === sentAt;
|
||||
});
|
||||
|
||||
if (reactionsBySource.length > 0) {
|
||||
|
@ -87,13 +87,14 @@ export class Reactions extends Collection<ReactionModel> {
|
|||
try {
|
||||
// The conversation the target message was in; we have to find it in the database
|
||||
// to to figure that out.
|
||||
const targetConversationId =
|
||||
window.ConversationController.ensureContactIds({
|
||||
const targetAuthorConversation =
|
||||
window.ConversationController.lookupOrCreate({
|
||||
uuid: reaction.get('targetAuthorUuid'),
|
||||
});
|
||||
const targetConversationId = targetAuthorConversation?.id;
|
||||
if (!targetConversationId) {
|
||||
throw new Error(
|
||||
'onReaction: No conversationId returned from ensureContactIds!'
|
||||
'onReaction: No conversationId returned from lookupOrCreate!'
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue