diff --git a/classes/article.php b/classes/article.php index 028901368..ff83143d6 100755 --- a/classes/article.php +++ b/classes/article.php @@ -697,18 +697,18 @@ class Article extends Handler_Protected { $ids_qmarks = arr_qmarks($ids); - if ($cmode == 0) { + if ($cmode == 1) { $sth = $pdo->prepare("UPDATE ttrss_user_entries SET - unread = false,last_read = NOW() - WHERE ref_id IN ($ids_qmarks) AND owner_uid = ?"); - } else if ($cmode == 1) { - $sth = $pdo->prepare("UPDATE ttrss_user_entries SET - unread = true - WHERE ref_id IN ($ids_qmarks) AND owner_uid = ?"); - } else { + unread = true + WHERE ref_id IN ($ids_qmarks) AND owner_uid = ?"); + } else if ($cmode == 2) { $sth = $pdo->prepare("UPDATE ttrss_user_entries SET unread = NOT unread,last_read = NOW() WHERE ref_id IN ($ids_qmarks) AND owner_uid = ?"); + } else { + $sth = $pdo->prepare("UPDATE ttrss_user_entries SET + unread = false,last_read = NOW() + WHERE ref_id IN ($ids_qmarks) AND owner_uid = ?"); } $sth->execute(array_merge($ids, [$owner_uid])); diff --git a/classes/rpc.php b/classes/rpc.php index 037e14132..725ca9622 100755 --- a/classes/rpc.php +++ b/classes/rpc.php @@ -287,7 +287,7 @@ class RPC extends Handler_Protected { /* GET["cmode"] = 0 - mark as read, 1 - as unread, 2 - toggle */ function catchupSelected() { $ids = explode(",", clean($_REQUEST["ids"])); - $cmode = sprintf("%d", clean($_REQUEST["cmode"])); + $cmode = (int)clean($_REQUEST["cmode"]); Article::catchupArticlesById($ids, $cmode); diff --git a/update.php b/update.php index 81a0ec725..3817c7e26 100755 --- a/update.php +++ b/update.php @@ -24,6 +24,7 @@ $longopts = array("feeds", "daemon", "daemon-loop", + "send-digests", "task:", "cleanup-tags", "quiet", @@ -87,6 +88,7 @@ print " --update-schema - update database schema\n"; print " --gen-search-idx - generate basic PostgreSQL fulltext search index\n"; print " --convert-filters - convert type1 filters to type2\n"; + print " --send-digests - send pending email digests\n"; print " --force-update - force update of all feeds\n"; print " --list-plugins - list all available plugins\n"; print " --debug-feed N - perform debug update of feed N\n"; @@ -432,6 +434,10 @@ exit($rc); } + if (isset($options["send-digests"])) { + Digest::send_headlines_digests(); + } + PluginHost::getInstance()->run_commands($options); if (file_exists(LOCK_DIRECTORY . "/$lock_filename"))