summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--extensions/BMO/template/en/default/hook/bug/comments-a_comment-end.html.tmpl4
-rw-r--r--extensions/Gravatar/Extension.pm8
-rw-r--r--extensions/Gravatar/lib/Data.pm20
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} . "&amp;size=$size";
+ return $self->{gravatar} . '&amp;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;