From 8399373f358260f05f10a73159c71ba6d81a7ca1 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Thu, 21 Aug 2014 15:08:15 +0000 Subject: [PATCH] Append aliases to mail vacation addresses insted of replacing them with existing one --- mail/js/app.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/mail/js/app.js b/mail/js/app.js index f887812ca4..f80a2eefde 100644 --- a/mail/js/app.js +++ b/mail/js/app.js @@ -3071,12 +3071,23 @@ app.classes.mail = AppJS.extend( sieve_vac_all_aliases: function() { var aliases = []; + var tmp = []; var addr = this.et2.getWidgetById('addresses'); var addresses = this.et2.getArrayMgr('sel_options').data.addresses; for(var id in addresses) aliases.push(id); - - addr.set_value(aliases); + if (addr) + { + tmp = aliases.concat(addr.get_value()); + + // returns de-duplicate items of an array + var deDuplicator = function (item,pos){ + return tmp.indexOf(item) == pos + }; + + aliases = tmp.filter(deDuplicator); + addr.set_value(aliases); + } }, /**