From 949ceaace6413cbc462cf5a212d27c5e10f1e33c Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Thu, 12 Jan 2012 23:13:28 +0800 Subject: Bug 715771: fix Profanivore failing when recipient doesn't have an account --- extensions/Profanivore/Extension.pm | 12 +++++------- 1 file 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(); -- cgit v1.2.3-24-g4f1b