summaryrefslogtreecommitdiffstats
path: root/extensions/Gravatar/Extension.pm
diff options
context:
space:
mode:
authorByron Jones <glob@mozilla.com>2015-05-18 16:13:41 +0200
committerByron Jones <glob@mozilla.com>2015-05-18 16:13:41 +0200
commit1e23e69630c37096d05e9a3ef31e824e912987d3 (patch)
tree6c2334efa9c3f63d35173d75e6bdbb914b6784a1 /extensions/Gravatar/Extension.pm
parent85152c6f92719d00962a84e6b850081a6b46a2da (diff)
downloadbugzilla-1e23e69630c37096d05e9a3ef31e824e912987d3.tar.gz
bugzilla-1e23e69630c37096d05e9a3ef31e824e912987d3.tar.xz
Bug 1165917: support tbplbot@gmail.com and treeherder@bots.tld as the tbpl/treeheder bot name
Diffstat (limited to 'extensions/Gravatar/Extension.pm')
-rw-r--r--extensions/Gravatar/Extension.pm8
1 files changed, 5 insertions, 3 deletions
diff --git a/extensions/Gravatar/Extension.pm b/extensions/Gravatar/Extension.pm
index 050a0c27d..3338790e7 100644
--- a/extensions/Gravatar/Extension.pm
+++ b/extensions/Gravatar/Extension.pm
@@ -12,6 +12,7 @@ use warnings;
use base qw(Bugzilla::Extension);
+use Bugzilla::Extension::Gravatar::Data qw( %gravatar_user_map );
use Bugzilla::User::Setting;
use Digest::MD5 qw(md5_hex);
@@ -27,11 +28,12 @@ sub _user_gravatar {
return DEFAULT_URL;
}
if (!$self->{gravatar}) {
- $self->{gravatar} = 'https://secure.gravatar.com/avatar/' .
- md5_hex(lc($self->email)) . '?d=mm';
+ my $email = $self->email;
+ $email = $gravatar_user_map{$self->email} if exists $gravatar_user_map{$self->email};
+ $self->{gravatar} = 'https://secure.gravatar.com/avatar/' . md5_hex(lc($email)) . '?d=mm';
}
$size ||= 64;
- return $self->{gravatar} . "&amp;size=$size";
+ return $self->{gravatar} . '&amp;size=' . $size;
}
sub install_before_final_checks {