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);
|
isGroupEmail(participant.handle);
|
||||||
|
|
||||||
const shouldCreateContact =
|
const shouldCreateContact =
|
||||||
|
!!participant.handle &&
|
||||||
!isParticipantConnectedAccount &&
|
!isParticipantConnectedAccount &&
|
||||||
!isExcludedByNonProfessionalEmails &&
|
!isExcludedByNonProfessionalEmails &&
|
||||||
!isExcludedByGroupEmails &&
|
!isExcludedByGroupEmails &&
|
||||||
|
|||||||
@ -66,10 +66,12 @@ const filterOutInternals = (
|
|||||||
}
|
}
|
||||||
|
|
||||||
const primaryHandleDomain = getDomainNameByEmail(primaryHandle);
|
const primaryHandleDomain = getDomainNameByEmail(primaryHandle);
|
||||||
const isAllHandlesFromSameDomain = message.participants.every(
|
const isAllHandlesFromSameDomain = message.participants
|
||||||
(participant) =>
|
.filter((participant) => !!participant.handle)
|
||||||
getDomainNameByEmail(participant.handle) === primaryHandleDomain,
|
.every(
|
||||||
);
|
(participant) =>
|
||||||
|
getDomainNameByEmail(participant.handle) === primaryHandleDomain,
|
||||||
|
);
|
||||||
|
|
||||||
if (isAllHandlesFromSameDomain) {
|
if (isAllHandlesFromSameDomain) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user