summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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