update: add option to send digests
This commit is contained in:
parent
6ae0a3dd3e
commit
3bd3324e5a
|
@ -697,18 +697,18 @@ class Article extends Handler_Protected {
|
|||
|
||||
$ids_qmarks = arr_qmarks($ids);
|
||||
|
||||
if ($cmode == 0) {
|
||||
$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) {
|
||||
if ($cmode == 1) {
|
||||
$sth = $pdo->prepare("UPDATE ttrss_user_entries SET
|
||||
unread = true
|
||||
WHERE ref_id IN ($ids_qmarks) AND owner_uid = ?");
|
||||
} else {
|
||||
} 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]));
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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"))
|
||||
|
|
Loading…
Reference in New Issue