]> git.wh0rd.org - tt-rss.git/commitdiff
support disabling of e-mail digests entirely
authorMike Frysinger <vapier@gmail.com>
Mon, 20 May 2013 18:47:57 +0000 (14:47 -0400)
committerMike Frysinger <vapier@gmail.com>
Mon, 10 Dec 2018 01:18:39 +0000 (20:18 -0500)
On servers w/out any support for sending e-mail, the digest functionality
is useless overhead and confusing for users.  Overload the existing digest
knob so people can turn it off.

classes/pref/feeds.php
classes/pref/prefs.php
classes/rssutils.php
config.php-dist

index a04b0108b870ed95cde29d1740dceffbd5fb66c9..8249f756a75726cb46d2b71a4389e1b9cd4adf23 100755 (executable)
@@ -660,6 +660,7 @@ class Pref_Feeds extends Handler_Protected {
                        print "<input dojoType=\"dijit.form.CheckBox\" type=\"checkbox\" name=\"private\" id=\"private\"
                        $checked>&nbsp;<label for=\"private\">".__('Hide from Popular feeds')."</label>";
 
+               if (DIGEST_SUBJECT !== false) {
                        $include_in_digest = $row["include_in_digest"];
 
                        if ($include_in_digest) {
@@ -671,6 +672,7 @@ class Pref_Feeds extends Handler_Protected {
                        print "<hr/><input dojoType=\"dijit.form.CheckBox\" type=\"checkbox\" id=\"include_in_digest\"
                        name=\"include_in_digest\"
                        $checked>&nbsp;<label for=\"include_in_digest\">".__('Include in e-mail digest')."</label>";
+               }
 
 
                        $always_display_enclosures = $row["always_display_enclosures"];
index 82456f342ea91d1e913a7d9565e5868b9500807a..0ae3e1bbb795a84b2b53a5b35eb10eb79971c019 100644 (file)
@@ -172,6 +172,7 @@ class Pref_Prefs extends Handler_Protected {
                                        "DEFAULT_UPDATE_INTERVAL", "USER_TIMEZONE", "SORT_HEADLINES_BY_FEED_DATE",
                                        "SSL_CERT_SERIAL", "DIGEST_PREFERRED_TIME");
 
+               $digest_options = array("DIGEST_ENABLE", "DIGEST_CATCHUP", "DIGEST_PREFERRED_TIME");
 
                $_SESSION["prefs_op_result"] = "";
 
@@ -502,6 +503,10 @@ class Pref_Prefs extends Handler_Protected {
                                continue;
                        }
 
+                       /* Hide options from the user that are disabled in config.php. */
+                       if (DIGEST_SUBJECT === false && in_array($pref_name, $digest_options))
+                               continue;
+
                        if ($active_section != $line["section_id"]) {
 
                                if ($active_section != "") {
index 56108bd1eefbbea82068c86c67025035f383a611..b469c47021058c08c10556484a749485eef8097c 100755 (executable)
@@ -217,6 +217,7 @@ class RSSUtils {
                }
 
                // Send feed digests by email if needed.
+               if (DIGEST_SUBJECT !== false)
                Digest::send_headlines_digests();
 
                return $nf;
index da9237ff6d455df08d768acd368030f7088d1506..a8817fae7964ab86223a1a1d581bf75edefea1ee 100755 (executable)
 
        define('DIGEST_SUBJECT', '[tt-rss] New headlines for last 24 hours');
        // Subject line for email digests
+       // Set this to false to disable digests entirely.
 
        // ***************************************
        // *** Other settings (less important) ***