summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2013-08-19 19:18:41 +0200
committerByron Jones <bjones@mozilla.com>2013-08-19 19:18:41 +0200
commitb4b2dd7998f7d4e5a47c942d11f802c0524b457f (patch)
treeb03c3b2d88b1eb6986927ca44fade57d0a0dbcdd
parent74cd3282458636431ea3ab40c143bb71adf6c69a (diff)
downloadbugzilla-b4b2dd7998f7d4e5a47c942d11f802c0524b457f.tar.gz
bugzilla-b4b2dd7998f7d4e5a47c942d11f802c0524b457f.tar.xz
Bug 906707: add the ability for someone to opt out of loading their gravatar
-rw-r--r--extensions/Gravatar/Extension.pm9
-rw-r--r--extensions/Gravatar/template/en/default/hook/global/setting-descs-settings.none.tmpl3
-rw-r--r--extensions/Gravatar/web/default.jpgbin0 -> 911 bytes
3 files changed, 9 insertions, 3 deletions
diff --git a/extensions/Gravatar/Extension.pm b/extensions/Gravatar/Extension.pm
index 3ff1a159d..1be0d4454 100644
--- a/extensions/Gravatar/Extension.pm
+++ b/extensions/Gravatar/Extension.pm
@@ -22,8 +22,12 @@ BEGIN {
sub _user_gravatar {
my ($self) = @_;
if (!$self->{gravatar}) {
- (my $email = $self->email) =~ s/\+(.*?)\@/@/;
- $self->{gravatar} = 'https://secure.gravatar.com/avatar/' . md5_hex(lc($email)) . "?size=32&d=mm";
+ if ($self->setting('show_my_gravatar') eq 'On') {
+ (my $email = $self->email) =~ s/\+(.*?)\@/@/;
+ $self->{gravatar} = 'https://secure.gravatar.com/avatar/' . md5_hex(lc($email)) . '?size=32&d=mm';
+ } else {
+ $self->{gravatar} = 'extensions/Gravatar/web/default.jpg';
+ }
}
return $self->{gravatar};
}
@@ -31,6 +35,7 @@ sub _user_gravatar {
sub install_before_final_checks {
my ($self, $args) = @_;
add_setting('show_gravatars', ['On', 'Off'], 'Off');
+ add_setting('show_my_gravatar', ['On', 'Off'], 'On');
}
__PACKAGE__->NAME;
diff --git a/extensions/Gravatar/template/en/default/hook/global/setting-descs-settings.none.tmpl b/extensions/Gravatar/template/en/default/hook/global/setting-descs-settings.none.tmpl
index 482503990..697cfef99 100644
--- a/extensions/Gravatar/template/en/default/hook/global/setting-descs-settings.none.tmpl
+++ b/extensions/Gravatar/template/en/default/hook/global/setting-descs-settings.none.tmpl
@@ -7,5 +7,6 @@
#%]
[%
- setting_descs.show_gravatars = "Show gravatar images when viewing $terms.bugs"
+ setting_descs.show_gravatars = "Show gravatar images when viewing $terms.bugs"
+ setting_descs.show_my_gravatar = "Show my gravatar image to other users"
%]
diff --git a/extensions/Gravatar/web/default.jpg b/extensions/Gravatar/web/default.jpg
new file mode 100644
index 000000000..8dc4e9501
--- /dev/null
+++ b/extensions/Gravatar/web/default.jpg
Binary files differ