Skip to content

Commit

Permalink
fix: user renamed to userObject
Browse files Browse the repository at this point in the history
Signed-off-by: yemkareems <yemkareems@gmail.com>
  • Loading branch information
yemkareems committed Oct 28, 2024
1 parent 4bd5530 commit b8038f4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/DigestSender.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,23 +69,23 @@ public function sendDigests(int $now): void {
// User got todays digest already
continue;
}
$user = $this->userManager->get($user);
if (!$user->isEnabled()) {
$userObject = $this->userManager->get($user);
if (!$userObject->isEnabled()) {
// User is disabled so do not send the email but update last sent since after enabling avoid flooding
$this->updateLastSentForUser($user, $now);
$this->updateLastSentForUser($userObject, $now);
continue;
}

try {
$this->sendDigestForUser($user, $now, $timezone, $language);
$this->sendDigestForUser($userObject, $now, $timezone, $language);
} catch (\Throwable $e) {
$this->logger->error('Exception occurred while sending user digest email', [
'exception' => $e,
]);
}
// We still update the digest time after an failed email,
// so it hopefully works tomorrow
$this->config->setUserValue($user->getUID(), 'activity', 'digest', $timezoneDigestDay[$timezone]);
$this->config->setUserValue($userObject->getUID(), 'activity', 'digest', $timezoneDigestDay[$timezone]);
}

$this->activityManager->setRequirePNG(false);
Expand Down

0 comments on commit b8038f4

Please sign in to comment.