summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2007-10-29 16:41:46 +0100
committerAndrew Dolgov <[email protected]>2007-10-29 16:41:46 +0100
commit9968d46f88e98b412b4e53658e9e1a6f62448499 (patch)
tree84afd6fbe25a1b467c96b4438dadae77a3b1e40c
parent0cacc891604d6c28f3dde88fdfd9287ca508bf4f (diff)
send_headline_digests: properly handle owner uid when marking articles as read
-rw-r--r--functions.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/functions.php b/functions.php
index f9a78b51b..9e9eb6f35 100644
--- a/functions.php
+++ b/functions.php
@@ -3250,7 +3250,7 @@
if ($rc) {
print "Marking affected articles as read...\n";
- catchupArticlesById($link, $affected_ids, 0);
+ catchupArticlesById($link, $affected_ids, 0, $line["id"]);
}
db_query($link, "UPDATE ttrss_users SET last_digest_sent = NOW()
@@ -3446,7 +3446,9 @@
}
}
- function catchupArticlesById($link, $ids, $cmode) {
+ function catchupArticlesById($link, $ids, $cmode, $owner_uid = false) {
+
+ if (!$owner_uid) $owner_uid = $_SESSION["uid"];
$tmp_ids = array();
@@ -3459,15 +3461,15 @@
if ($cmode == 0) {
db_query($link, "UPDATE ttrss_user_entries SET
unread = false,last_read = NOW()
- WHERE ($ids_qpart) AND owner_uid = " . $_SESSION["uid"]);
+ WHERE ($ids_qpart) AND owner_uid = $owner_uid");
} else if ($cmode == 1) {
db_query($link, "UPDATE ttrss_user_entries SET
unread = true
- WHERE ($ids_qpart) AND owner_uid = " . $_SESSION["uid"]);
+ WHERE ($ids_qpart) AND owner_uid = $owner_uid");
} else {
db_query($link, "UPDATE ttrss_user_entries SET
unread = NOT unread,last_read = NOW()
- WHERE ($ids_qpart) AND owner_uid = " . $_SESSION["uid"]);
+ WHERE ($ids_qpart) AND owner_uid = $owner_uid");
}
}