From 97e708f2e2f57b4833eb94b4758a0768a09d9ead Mon Sep 17 00:00:00 2001 From: nupplaPhil Date: Sat, 1 Feb 2020 23:34:50 +0100 Subject: [PATCH] Remove DI::app() dependency again --- mod/lostpass.php | 4 ++-- mod/removeme.php | 2 +- src/Core/Update.php | 4 ++-- src/Model/User.php | 4 ++-- src/Module/Admin/Users.php | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/mod/lostpass.php b/mod/lostpass.php index 04316a0996..e412c49586 100644 --- a/mod/lostpass.php +++ b/mod/lostpass.php @@ -65,7 +65,7 @@ function lostpass_post(App $a) Login Name: %3$s', $resetlink, DI::baseUrl(), $user['nickname'])); $email = DI::emailer() - ->newSystemMail(DI::app(), (!empty($user['language'])) ? DI::l10n()->withLang($user['language']) : DI::l10n()) + ->newSystemMail((!empty($user['language'])) ? DI::l10n()->withLang($user['language']) : DI::l10n()) ->withMessage(DI::l10n()->t('Password reset requested at %s', $sitename), $preamble, $body) ->forUser($user['uid'] ?? 0) ->withRecipient($user['email']) @@ -157,7 +157,7 @@ function lostpass_generate_password($user) ', DI::baseUrl(), $user['nickname'], $new_password)); $email = DI::emailer() - ->newSystemMail(DI::app(), (!empty($user['language'])) ? DI::l10n()->withLang($user['language']) : DI::l10n()) + ->newSystemMail((!empty($user['language'])) ? DI::l10n()->withLang($user['language']) : DI::l10n()) ->withMessage(DI::l10n()->t('Your password has been changed at %s', $sitename), $preamble, $body) ->forUser($user['uid'] ?? 0) ->withRecipient($user['email']) diff --git a/mod/removeme.php b/mod/removeme.php index 01a9b86da8..86d1f04e34 100644 --- a/mod/removeme.php +++ b/mod/removeme.php @@ -42,7 +42,7 @@ function removeme_post(App $a) } $email = DI::emailer() - ->newSystemMail(DI::app(), (!empty($admin['language'])) ? DI::l10n()->withLang($admin['language']) : DI::l10n()->withLang('en')) + ->newSystemMail((!empty($admin['language'])) ? DI::l10n()->withLang($admin['language']) : DI::l10n()->withLang('en')) ->withMessage(DI::l10n()->t('[Friendica System Notify]') . ' ' . DI::l10n()->t('User deleted their account'), DI::l10n()->t('On your Friendica node an user deleted their account. Please ensure that their data is removed from the backups.'), DI::l10n()->t('The user id is %d', local_user())) diff --git a/src/Core/Update.php b/src/Core/Update.php index 6eb056f573..2a3b3a68d6 100644 --- a/src/Core/Update.php +++ b/src/Core/Update.php @@ -264,7 +264,7 @@ class Update $body = $l10n->t("The error message is\n[pre]%s[/pre]", $error_message); $email = DI::emailer() - ->newSystemMail(DI::app(), $l10n) + ->newSystemMail($l10n) ->withMessage($l10n->t('[Friendica Notify] Database update'), $preamble, $body) ->forUser($admin['uid'] ?? 0) ->withRecipient($admin['email']) @@ -300,7 +300,7 @@ class Update $from_build, $to_build)); $email = DI::emailer() - ->newSystemMail(DI::app(), $l10n) + ->newSystemMail($l10n) ->withMessage($l10n->t('[Friendica Notify] Database update'), $preamble) ->forUser($admin['uid'] ?? 0) ->withRecipient($admin['email']) diff --git a/src/Model/User.php b/src/Model/User.php index dd94413758..1431dd0d82 100644 --- a/src/Model/User.php +++ b/src/Model/User.php @@ -898,7 +898,7 @@ class User )); $email = DI::emailer() - ->newSystemMail(DI::app(), DI::l10n()) + ->newSystemMail(DI::l10n()) ->withMessage(DI::l10n()->t('Registration at %s', $sitename), $body) ->forUser($user['uid'] ?? 0) ->withRecipient($user['email']) @@ -966,7 +966,7 @@ class User )); $email = DI::emailer() - ->newSystemMail(DI::app(), $l10n) + ->newSystemMail($l10n) ->withMessage(DI::l10n()->t('Registration details for %s', $sitename), $preamble, $body) ->forUser($user['uid'] ?? 0) ->withRecipient($user['email']) diff --git a/src/Module/Admin/Users.php b/src/Module/Admin/Users.php index d4e19da479..5ca50d11ac 100644 --- a/src/Module/Admin/Users.php +++ b/src/Module/Admin/Users.php @@ -77,7 +77,7 @@ class Users extends BaseAdmin $body = sprintf($body, DI::baseUrl()->get(), $user['nickname'], $result['password'], DI::config()->get('config', 'sitename')); $email = DI::emailer() - ->newSystemMail(DI::app(), (!empty($user['language'])) ? DI::l10n()->withLang($user['language']) : DI::l10n()) + ->newSystemMail((!empty($user['language'])) ? DI::l10n()->withLang($user['language']) : DI::l10n()) ->withMessage(DI::l10n()->t('Registration details for %s', DI::config()->get('config', 'sitename')), $preamble, $body) ->forUser($user['uid'] ?? 0) ->withRecipient($user['email']) -- 2.39.5