diff options
author | RaindropsSys <contact@minteck.org> | 2023-04-02 23:03:02 +0200 |
---|---|---|
committer | RaindropsSys <contact@minteck.org> | 2023-04-02 23:03:02 +0200 |
commit | 02eda3e4c9b4ba718f1fff70b7328ed8cdd5e63b (patch) | |
tree | 6d1dec61008998aadc6b69f7e750712794d99324 /includes/jobs/FrontersNotification.php | |
parent | f559308a1b42a9036135d764374a8c007b7d70a9 (diff) | |
download | pluralconnect-02eda3e4c9b4ba718f1fff70b7328ed8cdd5e63b.tar.gz pluralconnect-02eda3e4c9b4ba718f1fff70b7328ed8cdd5e63b.tar.bz2 pluralconnect-02eda3e4c9b4ba718f1fff70b7328ed8cdd5e63b.zip |
Updated 35 files, added 11 files and deleted includes/components/search.inc (automated)
Diffstat (limited to 'includes/jobs/FrontersNotification.php')
-rw-r--r-- | includes/jobs/FrontersNotification.php | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/includes/jobs/FrontersNotification.php b/includes/jobs/FrontersNotification.php index d95f273..f29a1e5 100644 --- a/includes/jobs/FrontersNotification.php +++ b/includes/jobs/FrontersNotification.php @@ -5,6 +5,12 @@ $_SERVER['DOCUMENT_ROOT'] = "../.."; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/composer/vendor/autoload.php'; use ColorThief\ColorThief; +if (!function_exists("formatPonypush")) { + function formatPonypush($message) { + return "Update to Ponypush 3.1.0 or later — (\$PA1$\$" . base64_encode($message) . "\$\$)"; + } +} + $app = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/app.json"), true); $system = $options["system"]; @@ -48,12 +54,12 @@ if (count($fronters["members"]) > 1) { 'method' => 'POST', 'header' => "Content-Type: text/plain\r\n" . - "Title: 🐴 Switch occurred in $name\r\n" . + "Title: " . formatPonypush("🐴 Switch occurred in $name") . "\r\n" . "Priority: default\r\n" . "Tags: switch\r\n" . "Actions: view, Open " . $fronters["members"][0]["display_name"] . " on Cold Haze, https://ponies.equestria.horse/" . $fronters["members"][0]["name"] . "/, clear=true;view, Open " . $fronters["members"][1]["display_name"] . " on Cold Haze, https://ponies.equestria.horse/" . $fronters["members"][1]["name"] . "/, clear=true\r\n" . "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]), - 'content' => ($fronters["members"][0]["display_name"] ?? $fronters["members"][0]["name"]) . " and " . ($fronters["members"][1]["display_name"] ?? $fronters["members"][1]["name"]) . " switched in just now" + 'content' => formatPonypush(($fronters["members"][0]["display_name"] ?? $fronters["members"][0]["name"]) . " and " . ($fronters["members"][1]["display_name"] ?? $fronters["members"][1]["name"]) . " switched in just now") ] ]); } else if (count($fronters["members"]) > 0) { @@ -62,12 +68,12 @@ if (count($fronters["members"]) > 1) { 'method' => 'POST', 'header' => "Content-Type: text/plain\r\n" . - "Title: 🐴 Switch occurred in $name\r\n" . + "Title: " . formatPonypush("🐴 Switch occurred in $name") . "\r\n" . "Priority: default\r\n" . "Tags: switch\r\n" . "Actions: view, Open on Cold Haze, https://ponies.equestria.horse/" . $fronters["members"][0]["name"] . "/, clear=true\r\n" . "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]), - 'content' => ($fronters["members"][0]["display_name"] ?? $fronters["members"][0]["name"]) . " switched in just now" + 'content' => formatPonypush(($fronters["members"][0]["display_name"] ?? $fronters["members"][0]["name"]) . " switched in just now") ] ]); } else { @@ -76,12 +82,12 @@ if (count($fronters["members"]) > 1) { 'method' => 'POST', 'header' => "Content-Type: text/plain\r\n" . - "Title: 🐴 Switch occurred in $name\r\n" . + "Title: " . formatPonypush("🐴 Switch occurred in $name") . "\r\n" . "Priority: default\r\n" . "Tags: switch\r\n" . "Actions: view, Open on Cold Haze, https://ponies.equestria.horse/, clear=true\r\n" . "Authorization: Basic " . base64_encode($ntfy["user"] . ":" . $ntfy["password"]), - 'content' => "The fallback pony switched in just now" + 'content' => formatPonypush("The fallback pony switched in just now") ] ]); } |