@@ -3250,7 +3250,7 @@ function send_headlines_digests($link, $limit = 100) {
3250
3250
3251
3251
if ($ rc ) {
3252
3252
print "Marking affected articles as read... \n" ;
3253
- catchupArticlesById ($ link , $ affected_ids , 0 );
3253
+ catchupArticlesById ($ link , $ affected_ids , 0 , $ line [ " id " ] );
3254
3254
}
3255
3255
3256
3256
db_query ($ link , "UPDATE ttrss_users SET last_digest_sent = NOW()
@@ -3446,7 +3446,9 @@ function publishArticlesById($link, $ids, $cmode) {
3446
3446
}
3447
3447
}
3448
3448
3449
- function catchupArticlesById ($ link , $ ids , $ cmode ) {
3449
+ function catchupArticlesById ($ link , $ ids , $ cmode , $ owner_uid = false ) {
3450
+
3451
+ if (!$ owner_uid ) $ owner_uid = $ _SESSION ["uid " ];
3450
3452
3451
3453
$ tmp_ids = array ();
3452
3454
@@ -3459,15 +3461,15 @@ function catchupArticlesById($link, $ids, $cmode) {
3459
3461
if ($ cmode == 0 ) {
3460
3462
db_query ($ link , "UPDATE ttrss_user_entries SET
3461
3463
unread = false,last_read = NOW()
3462
- WHERE ( $ ids_qpart) AND owner_uid = " . $ _SESSION [ " uid " ] );
3464
+ WHERE ( $ ids_qpart) AND owner_uid = $ owner_uid " );
3463
3465
} else if ($ cmode == 1 ) {
3464
3466
db_query ($ link , "UPDATE ttrss_user_entries SET
3465
3467
unread = true
3466
- WHERE ( $ ids_qpart) AND owner_uid = " . $ _SESSION [ " uid " ] );
3468
+ WHERE ( $ ids_qpart) AND owner_uid = $ owner_uid " );
3467
3469
} else {
3468
3470
db_query ($ link , "UPDATE ttrss_user_entries SET
3469
3471
unread = NOT unread,last_read = NOW()
3470
- WHERE ( $ ids_qpart) AND owner_uid = " . $ _SESSION [ " uid " ] );
3472
+ WHERE ( $ ids_qpart) AND owner_uid = $ owner_uid " );
3471
3473
}
3472
3474
}
3473
3475
0 commit comments