File tree Expand file tree Collapse file tree
services/apps/data_sink_worker/src/service Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99 distinctBy ,
1010 escapeNullByte ,
1111 generateUUIDv1 ,
12+ isDomainExcluded ,
1213 isValidEmail ,
1314 parseGitHubNoreplyEmail ,
1415 single ,
@@ -1450,12 +1451,10 @@ export default class ActivityService extends LoggerBase {
14501451 ) as boolean
14511452
14521453 if ( ! isBot ) {
1453- const verifiedEmailIdentity = payload . activity . member . identities ?. find (
1454- ( i ) => i . type === MemberIdentityType . EMAIL && i . verified ,
1455- )
1456- const emailDomain = verifiedEmailIdentity
1457- ? verifiedEmailIdentity . value . split ( '@' ) [ 1 ]
1458- : undefined
1454+ const emailDomain = payload . activity . member . identities
1455+ ?. filter ( ( i ) => i . type === MemberIdentityType . EMAIL && i . verified )
1456+ . map ( ( i ) => i . value . split ( '@' ) [ 1 ] ?. toLowerCase ( ) )
1457+ . find ( ( domain ) => domain && ! isDomainExcluded ( domain ) )
14591458
14601459 // associate activity with organization
14611460 payload . organizationId = await this . commonMemberService . findAffiliation (
You can’t perform that action at this time.
0 commit comments