Commit 8e855f2d authored by myk%mozilla.org's avatar myk%mozilla.org

Fix for bug 128422: Fixes serious tree horkage where everyone gets email on all…

Fix for bug 128422: Fixes serious tree horkage where everyone gets email on all changes regardless of email preferences. Fix by Myk Melez <myk@mozilla.org>. r=gerv@mozilla.org, waiting on second review but checking in now due to severity of bug.
parent ab4e4fe7
...@@ -45,10 +45,12 @@ my $userid; ...@@ -45,10 +45,12 @@ my $userid;
# The default email flags leave all email on. # The default email flags leave all email on.
my $defaultflagstring = "ExcludeSelf~on~"; my $defaultflagstring = "ExcludeSelf~on~";
foreach my $role ("Owner", "Reporter", "QAcontact", "CClist", "Voter") { my @roles = ("Owner", "Reporter", "QAcontact", "CClist", "Voter");
foreach my $reason ("Removeme", "Comments", "Attachments", "Status", my @reasons = ("Removeme", "Comments", "Attachments", "Status", "Resolved",
"Resolved", "Keywords", "CC", "Other") "Keywords", "CC", "Other");
{
foreach my $role (@roles) {
foreach my $reason (@reasons) {
$defaultflagstring .= "email$role$reason~on~"; $defaultflagstring .= "email$role$reason~on~";
} }
} }
...@@ -174,9 +176,15 @@ sub SaveEmail { ...@@ -174,9 +176,15 @@ sub SaveEmail {
$updateString .= 'ExcludeSelf~'; $updateString .= 'ExcludeSelf~';
} }
foreach my $key (keys %::FORM) { foreach my $role (@roles) {
if ($key =~ /email([A-Z]+[a-z]+)([A-Z]+[a-z]*)/) { foreach my $reason (@reasons) {
$updateString .= "~$key~on"; # Add this preference to the list without giving it a value,
# which is the equivalent of setting the value to "off."
$updateString .= "~email$role$reason~";
# If the form field for this preference is defined, then we
# know the checkbox was checked, so set the value to "on".
$updateString .= "on" if defined $::FORM{"email$role$reason"};
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment