summaryrefslogtreecommitdiff
path: root/program/js/app.js
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2008-06-24 13:04:57 +0000
committeralecpl <alec@alec.pl>2008-06-24 13:04:57 +0000
commitddd776b2a3a264777233410e4bb311233fd24d3c (patch)
tree15aedb73a344bf4c02e1c89e1f6d5f123f05a842 /program/js/app.js
parent0339e3cc6fcc0df6d0dcd9b434f3dff919adcf7f (diff)
- Allow trash/junk subfolders to be purged (#1485085)
Diffstat (limited to 'program/js/app.js')
-rw-r--r--program/js/app.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/program/js/app.js b/program/js/app.js
index abd5ca748..74e027403 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -203,7 +203,10 @@ function rcube_webmail()
if (this.env.messagecount)
this.enable_command('select-all', 'select-none', 'expunge', true);
- if (this.env.messagecount && (this.env.mailbox==this.env.trash_mailbox || this.env.mailbox==this.env.junk_mailbox))
+ if (this.env.messagecount
+ && (this.env.mailbox == this.env.trash_mailbox || this.env.mailbox == this.env.junk_mailbox
+ || this.env.mailbox.match('^' + RegExp.escape(this.env.trash_mailbox) + RegExp.escape(this.env.delimiter))
+ || this.env.mailbox.match('^' + RegExp.escape(this.env.junk_mailbox) + RegExp.escape(this.env.delimiter))))
this.enable_command('purge', true);
this.set_page_buttons();
@@ -3559,7 +3562,11 @@ function rcube_webmail()
case 'check-recent':
case 'getunread':
this.enable_command('show', 'expunge', 'select-all', 'select-none', 'sort', (this.env.messagecount > 0));
- this.enable_command('purge', (this.env.messagecount && (this.env.mailbox==this.env.trash_mailbox || this.env.mailbox==this.env.junk_mailbox)));
+ var mailboxtest = (this.env.mailbox == this.env.trash_mailbox || this.env.mailbox == this.env.junk_mailbox
+ || this.env.mailbox.match('^' + RegExp.escape(this.env.trash_mailbox) + RegExp.escape(this.env.delimiter))
+ || this.env.mailbox.match('^' + RegExp.escape(this.env.junk_mailbox) + RegExp.escape(this.env.delimiter))) ? true : false;
+
+ this.enable_command('purge', (this.env.messagecount && mailboxtest));
break;