From a7dcd8e539c0ad643c848fbfcea240751404e611 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Tue, 14 Apr 2009 20:55:36 -0600 Subject: [PATCH] Update flag in base view also if currently in search view --- imp/js/src/DimpBase.js | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/imp/js/src/DimpBase.js b/imp/js/src/DimpBase.js index 5cf5ba9b1..795ace025 100644 --- a/imp/js/src/DimpBase.js +++ b/imp/js/src/DimpBase.js @@ -2162,15 +2162,29 @@ var DimpBase = { add = this.convertFlag(flag, add); vs.get('dataob').each(function(ob) { - ob.flag = ob.flag.without(flag); - if (add) { - ob.flag.push(flag); + this._updateFlag(ob, flag, add); + + /* If this is a search mailbox, also need to update flag in base + * view, if it is in the buffer. */ + if (this.isSearch()) { + var tmp = this.viewport.getSelection(ob.view).search({ imapuid: { equal: [ ob.imapuid ] }, view: { equal: [ ob.view ] } }); + if (tmp.size()) { + this._updateFlag(tmp.get('dataob').first(), flag, add); + } } - - this.viewport.updateRow(ob); }, this); }, + _updateFlag: function(ob, flag, add) + { + ob.flag = ob.flag.without(flag); + if (add) { + ob.flag.push(flag); + } + + this.viewport.updateRow(ob); + }, + /* Miscellaneous folder actions. */ purgeDeleted: function() { -- 2.11.0