Skip to content

Commit

Permalink
fixup! Fix: duplicating contacts with the Recently contacted feature
Browse files Browse the repository at this point in the history
Signed-off-by: hamza221 <[email protected]>
  • Loading branch information
hamza221 committed Oct 22, 2023
1 parent 0ca50a7 commit eceb546
Showing 1 changed file with 1 addition and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,12 @@ public function handle(Event $event): void {
$uid = $event->getUid();
$email = $event->getEmail();
$federatedCloudId = $event->getFederatedCloudId();



$existingContact = $this->cardSearchDao->findExisting(
$event->getActor(),
$uid,
$email,
$federatedCloudId);

if ($existingContact !== null) {
return;
}
Expand All @@ -94,7 +92,6 @@ public function handle(Event $event): void {
$email,
$federatedCloudId
);

if (!empty($existingRecentlyContacted)) {
$now = $this->timeFactory->getTime();
foreach ($existingRecentlyContacted as $c) {
Expand All @@ -117,14 +114,6 @@ public function handle(Event $event): void {
$contact->setFederatedCloudId($federatedCloudId);
}
$contact->setLastContact($this->timeFactory->getTime());

$copy = $this->cardSearchDao->findExisting(
$event->getActor(),
$uid,
$email,
$federatedCloudId
);

$contact->setCard($this->generateCard($contact));

$this->mapper->insert($contact);
Expand Down

0 comments on commit eceb546

Please sign in to comment.