Various code cleanup.

This commit is contained in:
James Cole
2022-12-30 09:28:03 +01:00
parent 03e176bd16
commit ee0116f112
17 changed files with 171 additions and 125 deletions

View File

@@ -25,10 +25,12 @@ declare(strict_types=1);
namespace FireflyIII\Notifications\User;
use Exception;
use FireflyIII\Exceptions\FireflyException;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Messages\SlackMessage;
use Illuminate\Notifications\Notification;
use Illuminate\Support\Facades\Log;
class UserLogin extends Notification
{
@@ -70,8 +72,9 @@ class UserLogin extends Notification
$time = now(config('app.timezone'))->isoFormat((string)trans('config.date_time_js'));
$host = '';
try {
$hostName = gethostbyaddr($this->ip);
} catch (Exception $e) {
$hostName = app('steam')->getHostName($this->ip);
} catch (FireflyException $e) {
Log::error($e->getMessage());
$hostName = $this->ip;
}
if ($hostName !== $this->ip) {
@@ -93,8 +96,9 @@ class UserLogin extends Notification
{
$host = '';
try {
$hostName = gethostbyaddr($this->ip);
} catch (Exception $e) {
$hostName = app('steam')->getHostName($this->ip);
} catch (FireflyException $e) {
Log::error($e->getMessage());
$hostName = $this->ip;
}
if ($hostName !== $this->ip) {