diff options
Diffstat (limited to 'includes/jobs')
-rw-r--r-- | includes/jobs/FrontersNotification.php | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/includes/jobs/FrontersNotification.php b/includes/jobs/FrontersNotification.php index 888b640..b4b8ae2 100644 --- a/includes/jobs/FrontersNotification.php +++ b/includes/jobs/FrontersNotification.php @@ -34,28 +34,6 @@ file_put_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/$system/last.json" $ntfy = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true)["ntfy"]; -if (count($fronters["members"]) > 0 && ($system !== $app["other"]["id"] || !isset($app["other"]))) { - foreach ($fronters["members"] as $member) { - if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $member["id"] . ".json")) { - $metadata = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/metadata/" . $member["id"] . ".json"), true); - - if (!isset($metadata["birth"])) { - echo("Showing age warning\n"); - showWarning($member["display_name"] ?? $member["name"], $member["name"], $system); - } else if (isset($metadata['birth']["age"]) && $metadata["birth"]["age"] === 0 && (!isset($metadata['birth']["year"]) || $metadata["birth"]["year"] < 1900)) { - echo("Showing age warning\n"); - showWarning($member["display_name"] ?? $member["name"], $member["name"], $system); - } else if (isset($metadata['birth']["year"]) && $metadata["birth"]["year"] < 1900) { - echo("Showing age warning\n"); - showWarning($member["display_name"] ?? $member["name"], $member["name"], $system); - } else if (!isset($metadata['birth']["year"]) && !isset($metadata['birth']["age"])) { - echo("Showing age warning\n"); - showWarning($member["display_name"] ?? $member["name"], $member["name"], $system); - } - } - } -} - if (count($fronters["members"]) > 1) { echo("Creating context for 2 members\n"); $context = stream_context_create([ @@ -115,4 +93,4 @@ if ($system === "gdapd") { } echo("Sending to specific channel ($topic)\n"); -file_get_contents('https://' . $ntfy["server"] . '/' . $topic, false, $context);
\ No newline at end of file +file_get_contents('https://' . $ntfy["server"] . '/' . $topic, false, $context); |