summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2012-01-12 16:13:28 +0100
committerByron Jones <bjones@mozilla.com>2012-01-12 16:13:28 +0100
commit949ceaace6413cbc462cf5a212d27c5e10f1e33c (patch)
treed48b2d9c2259e7e3325e85805c537dd3afcc7eed
parentaed743e23b791f39cd3d31629fe65a36a623739f (diff)
downloadbugzilla-949ceaace6413cbc462cf5a212d27c5e10f1e33c.tar.gz
bugzilla-949ceaace6413cbc462cf5a212d27c5e10f1e33c.tar.xz
Bug 715771: fix Profanivore failing when recipient doesn't have an account
-rw-r--r--extensions/Profanivore/Extension.pm12
1 files changed, 5 insertions, 7 deletions
diff --git a/extensions/Profanivore/Extension.pm b/extensions/Profanivore/Extension.pm
index fad909c39..b77c09ce3 100644
--- a/extensions/Profanivore/Extension.pm
+++ b/extensions/Profanivore/Extension.pm
@@ -59,20 +59,18 @@ sub mailer_before_send {
my $author = $email->header("X-Bugzilla-Who");
my $recipient = $email->header("To");
- if ($author && $recipient) {
+ if ($author && $recipient && lc($author) ne lc($recipient)) {
my $email_suffix = Bugzilla->params->{'emailsuffix'};
if ($email_suffix ne '') {
$recipient =~ s/\Q$email_suffix\E$//;
$author =~ s/\Q$email_suffix\E$//;
}
-
- $author = new Bugzilla::User({ name => $author });
- $recipient = new Bugzilla::User({ name => $recipient });
-
+
+ $author = new Bugzilla::User({ name => $author });
+
if ($author &&
$author->id &&
- !$author->in_group('editbugs') &&
- $author->id ne $recipient->id)
+ !$author->in_group('editbugs'))
{
my $body = $email->body_str();