From b808d36a7b5af459e1aade4ffca78e8716c16f6c Mon Sep 17 00:00:00 2001 From: Ceda EI Date: Fri, 6 Jul 2018 15:02:09 +0530 Subject: [PATCH] Change messages. Not send 1 members in /all_chains --- update_chain.php | 5 ++++- webhook.php | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/update_chain.php b/update_chain.php index 13bd0e3..d759388 100644 --- a/update_chain.php +++ b/update_chain.php @@ -106,7 +106,7 @@ function chain_to_string($chain) { for ($i = count($chain) - 1; $i >= 0 ; $i--) { $string .= $chain[$i]['username']; if ($i != 0) { - $string .= "\n"; + $string .= " → "; } } return $string; @@ -144,6 +144,9 @@ if ($argv[1] == "all") { $end_points = $conn->query($query); while ($end_point = $end_points->fetch_assoc()){ $chain = get_chain_from_user($end_point); + if (count($chain) == 1){ + continue; + } send_text(chain_to_string($chain)); } exit(); diff --git a/webhook.php b/webhook.php index 687b9cf..cd32928 100644 --- a/webhook.php +++ b/webhook.php @@ -89,7 +89,7 @@ function member_exit() { } function update() { - send_html("Update started. New chain will only be send if the chain has changed. Please wait as this takes about a minute."); + send_html("Update started. Please wait as this takes about a minute."); exec('echo php ' . __DIR__ . '/update_chain.php send | at now'); }