summaryrefslogtreecommitdiff
path: root/viewfeed.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2009-02-04 22:55:01 +0300
committerAndrew Dolgov <[email protected]>2009-02-04 22:55:01 +0300
commit1a00325836c25ed77793ddf2e66abbf68857b4ed (patch)
treef54ed6e544f81c9fe2102b393019063e95546c7e /viewfeed.js
parent69ea0cdd1b7dbbf7aef010fd707d93030c002cae (diff)
toggleUnread: handle local db
Diffstat (limited to 'viewfeed.js')
-rw-r--r--viewfeed.js21
1 files changed, 20 insertions, 1 deletions
diff --git a/viewfeed.js b/viewfeed.js
index 5166304d3..acce5310d 100644
--- a/viewfeed.js
+++ b/viewfeed.js
@@ -811,6 +811,12 @@ function toggleUnread(id, cmode, effect) {
} else {
row.className = nc + "Unread";
}
+
+ if (db) {
+ db.execute("UPDATE articles SET unread = not unread "+
+ "WHERE id = ?", [id]);
+ }
+
} else if (cmode == 0) {
row.className = nc;
@@ -819,10 +825,24 @@ function toggleUnread(id, cmode, effect) {
afterFinish: toggleUnread_afh,
queue: { position:'end', scope: 'TMRQ-' + id, limit: 1 } } );
}
+
+ if (db) {
+ db.execute("UPDATE articles SET unread = 0 "+
+ "WHERE id = ?", [id]);
+ }
+
} else if (cmode == 1) {
row.className = nc + "Unread";
+
+ if (db) {
+ db.execute("UPDATE articles SET unread = 1 "+
+ "WHERE id = ?", [id]);
+ }
+
}
+ update_local_feedlist_counters();
+
// Disable unmarking as selected for the time being (16.05.08) -fox
if (is_selected) row.className = row.className + "Selected";
@@ -840,7 +860,6 @@ function toggleUnread(id, cmode, effect) {
}
-
} catch (e) {
exception_error("toggleUnread", e);
}