Removing empty handles from MessageWithParticipants (#10625)
fixes https://github.com/twentyhq/twenty/issues/10623
This commit is contained in:
@ -83,6 +83,7 @@ export class MessagingSaveMessagesAndEnqueueContactCreationService {
|
||||
isGroupEmail(participant.handle);
|
||||
|
||||
const shouldCreateContact =
|
||||
!!participant.handle &&
|
||||
!isParticipantConnectedAccount &&
|
||||
!isExcludedByNonProfessionalEmails &&
|
||||
!isExcludedByGroupEmails &&
|
||||
|
||||
@ -66,10 +66,12 @@ const filterOutInternals = (
|
||||
}
|
||||
|
||||
const primaryHandleDomain = getDomainNameByEmail(primaryHandle);
|
||||
const isAllHandlesFromSameDomain = message.participants.every(
|
||||
(participant) =>
|
||||
getDomainNameByEmail(participant.handle) === primaryHandleDomain,
|
||||
);
|
||||
const isAllHandlesFromSameDomain = message.participants
|
||||
.filter((participant) => !!participant.handle)
|
||||
.every(
|
||||
(participant) =>
|
||||
getDomainNameByEmail(participant.handle) === primaryHandleDomain,
|
||||
);
|
||||
|
||||
if (isAllHandlesFromSameDomain) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user