diff options
author | Byron Jones <glob@mozilla.com> | 2015-05-18 16:13:41 +0200 |
---|---|---|
committer | Byron Jones <glob@mozilla.com> | 2015-05-18 16:13:41 +0200 |
commit | 1e23e69630c37096d05e9a3ef31e824e912987d3 (patch) | |
tree | 6c2334efa9c3f63d35173d75e6bdbb914b6784a1 | |
parent | 85152c6f92719d00962a84e6b850081a6b46a2da (diff) | |
download | bugzilla-1e23e69630c37096d05e9a3ef31e824e912987d3.tar.gz bugzilla-1e23e69630c37096d05e9a3ef31e824e912987d3.tar.xz |
Bug 1165917: support tbplbot@gmail.com and treeherder@bots.tld as the tbpl/treeheder bot name
-rw-r--r-- | extensions/BMO/template/en/default/hook/bug/comments-a_comment-end.html.tmpl | 4 | ||||
-rw-r--r-- | extensions/Gravatar/Extension.pm | 8 | ||||
-rw-r--r-- | extensions/Gravatar/lib/Data.pm | 20 |
3 files changed, 28 insertions, 4 deletions
diff --git a/extensions/BMO/template/en/default/hook/bug/comments-a_comment-end.html.tmpl b/extensions/BMO/template/en/default/hook/bug/comments-a_comment-end.html.tmpl index caf7acca7..56e11062d 100644 --- a/extensions/BMO/template/en/default/hook/bug/comments-a_comment-end.html.tmpl +++ b/extensions/BMO/template/en/default/hook/bug/comments-a_comment-end.html.tmpl @@ -6,7 +6,9 @@ # defined by the Mozilla Public License, v. 2.0. #%] -[% IF user.id && comment.author.login_name == 'tbplbot@gmail.com' %] +[% IF user.id + && (comment.author.login_name == 'tbplbot@gmail.com' || comment.author.login_name == 'treeherder@bots.tld') +%] [% has_tbpl_comment = 1 %] <script> var id = [% count FILTER none %]; 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} . "&size=$size"; + return $self->{gravatar} . '&size=' . $size; } sub install_before_final_checks { diff --git a/extensions/Gravatar/lib/Data.pm b/extensions/Gravatar/lib/Data.pm new file mode 100644 index 000000000..31e33ad0f --- /dev/null +++ b/extensions/Gravatar/lib/Data.pm @@ -0,0 +1,20 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# This Source Code Form is "Incompatible With Secondary Licenses", as +# defined by the Mozilla Public License, v. 2.0. + +package Bugzilla::Extension::Gravatar::Data; +use strict; + +use base 'Exporter'; +our @EXPORT_OK = qw( + %gravatar_user_map +); + +our %gravatar_user_map = ( + 'treeherder@bots.tld' => 'tbplbot@gmail.com', +); + +1; |