Fix seen flagging.
authorMichael M Slusarz <slusarz@curecanti.org>
Sun, 22 Feb 2009 07:59:39 +0000 (00:59 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Sun, 22 Feb 2009 07:59:39 +0000 (00:59 -0700)
Also, fix setting seen flag on server if user manually set unseen flag
on message viewed in preview pane.

imp/js/src/DimpBase.js

index bb84024..d3da2eb 100644 (file)
@@ -875,6 +875,12 @@ var DimpBase = {
             pp_uid = data.imapuid + data.view;
 
             if (this.ppfifo.indexOf(pp_uid) != -1) {
+                  // There is a chance that the message may have been marked
+                  // as unseen since first being viewed. If so, we need to
+                  // explicitly flag as seen here.
+                if (data.bg.indexOf('unseen') != -1) {
+                    this.flag('seen');
+                }
                 return this._loadPreviewCallback(this.ppcache[pp_uid]);
             }
         }
@@ -2093,7 +2099,7 @@ var DimpBase = {
             args = { view: this.folder, flags: [ '-\\seen' ].toJSON() };
             if (action == 'seen') {
                 unseenstatus = 0;
-                args.flags = [ '\\seen' ];
+                args.flags = [ '\\seen' ].toJSON();
             }
             obs = vs.get('dataob');
             if (obs.size()) {