offline: sync marked/unread status

This commit is contained in:
Andrew Dolgov
2009-02-17 12:22:31 +03:00
parent 65c0779b77
commit 492a4a6ac8
2 changed files with 27 additions and 7 deletions

View File

@@ -658,8 +658,17 @@ function offline_download_parse(stage, transport) {
if (sync_ok.length > 0) {
for (var i = 0; i < sync_ok.length; i++) {
var id = sync_ok[i].getAttribute("id");
var unread = sync_ok[i].getAttribute("unread");
var marked = sync_ok[i].getAttribute("marked");
if (id) {
debug("synced offline info for id " + id);
if (unread != undefined && marked != undefined) {
db.execute("UPDATE articles SET "+
"unread = ?, marked = ? WHERE id = ?", [unread, marked, id]);
}
db.execute("UPDATE articles SET modified = '' WHERE id = ?", [id]);
}
}