Feature #42623
openAdds initials to the list of default gratavar options
Added by Marius BĂLTEANU 6 days ago. Updated about 1 hour ago.
0%
Description
- https://blog.gravatar.com/2025/02/19/initials-avatars-email-signatures/
- https://docs.gravatar.com/api/avatars/images/
The attached patch adds this to the list of available options.
Files
0001-Adds-gravatar-initials.patch (2.99 KB) 0001-Adds-gravatar-initials.patch | Marius BĂLTEANU, 2025-04-24 23:02 | ||
0001-Adds-Initials-to-the-list-of-default-gratavar-option.patch (6.31 KB) 0001-Adds-Initials-to-the-list-of-default-gratavar-option.patch | Marius BĂLTEANU, 2025-04-29 22:09 |
Related issues
Updated by Marius BĂLTEANU 6 days ago
- Related to Feature #29824: Add user initials when Gravatar is disabled added
Updated by Marius BĂLTEANU 6 days ago
Two points to clarify:
1. I'm aware about the privacy discussions from #29824, but being an option that must be configured manually from the administration, I think it is safe.
2. The patch was inspired by the patch added by Felix in the #29824, but I think it is better to use the display name to generate the initials.
Go MAEDA, what do you think?
Updated by Go MAEDA 6 days ago
Marius BĂLTEANU wrote in #note-2:
1. I'm aware about the privacy discussions from #29824, but being an option that must be configured manually from the administration, I think it is safe.
I agree, but I think we should display a warning such as the following below the "Default Gravatar image" setting:
When "Initials" is selected, users' names will be sent to https://www.gravatar.com while displaying user icons."
2. The patch was inspired by the patch added by Felix in the #29824, but I think it is better to use the display name to generate the initials.
I think so too for the following reasons:
- User names are not always displayed with the
firstname lastname
order. Redmine also supports the "lastname firstname". It is easy to generate initials with the order if the display name (User#name
) is used. - Always displaying the first letters of first and last name may cause a privacy problem. For example, when user names are displayed in the
#{login}
style on Redmine, the current implementation reveals two characters of user names that are not visible for non-admin users.
To address the above, I suggest the following implementation.
def initials
name_part1, name_part2 = name.split
if name_part2.present?
name_part1.first + name_part2.first
else
name_part1.first(2)
end
end
Updated by Marius BĂLTEANU 1 day ago
- File 0001-Adds-Initials-to-the-list-of-default-gratavar-option.patch 0001-Adds-Initials-to-the-list-of-default-gratavar-option.patch added
- Target version changed from Candidate for next major release to 6.1.0
Go MAEDA wrote in #note-3:
[...]
I agree, but I think we should display a warning such as the following below the "Default Gravatar image" setting:
When "Initials" is selected, users' names will be sent to https://www.gravatar.com while displaying user icons.
In most of the cases, the message is not really correct because we send only the initials to the Gratavar service. Indeed, there are some cases where initials can be the same with the name.
What to you think about a generic message?
Users' email addresses and initials (when selected) are sent to https://www.gravatar.com to generate their avatars.
[...]
I think so too for the following reasons:
- User names are not always displayed with the
firstname lastname
order. Redmine also supports the "lastname firstname". It is easy to generate initials with the order if the display name (User#name
) is used.- Always displaying the first letters of first and last name may cause a privacy problem. For example, when user names are displayed in the
#{login}
style on Redmine, the current implementation reveals two characters of user names that are not visible for non-admin users.To address the above, I suggest the following implementation.
[...]
I've changed the implementation to generate the initials based on the user display format in order to be more consistent. Please let me know if this works better for you.
I'm assigning this to 6.1.0 to discuss it.
Updated by Go MAEDA about 15 hours ago
Thank you for updating the patch.
Marius BĂLTEANU wrote in #note-4:
In most of the cases, the message is not really correct because we send only the initials to the Gratavar service. Indeed, there are some cases where initials can be the same with the name.
What to you think about a generic message?
Users' email addresses and initials (when selected) are sent to https://www.gravatar.com to generate their avatars.
Since email addresses are hashed with SHA256 before being sent, it does not cause a privacy issue. A privacy issue only happens when "Initials" is selected, so I think the message should focus on the fact that initials are being sent. I prefer a message like the following:
When "Initials" is selected, users' initials are sent to https://www.gravatar.com to generate their avatars.
I've changed the implementation to generate the initials based on the user display format in order to be more consistent. Please let me know if this works better for you.
The implementation is more sophisticated than the code I suggested in #note-3. However, it needs a slight fix. The value of :initials
for :lastname_firstname
should be '#{lastname.to_s.first}#{firstname.to_s.first}'
(remove the space between the two characters).
Updated by Marius BĂLTEANU about 1 hour ago
- Assignee set to Marius BĂLTEANU
Go MAEDA wrote in #note-5:
Since email addresses are hashed with SHA256 before being sent, it does not cause a privacy issue. A privacy issue only happens when "Initials" is selected, so I think the message should focus on the fact that initials are being sent. I prefer a message like the following:
[...]
I'm sorry, I totally forgot about the hashing. In this case, I fully agree with you about the message.
I've changed the implementation to generate the initials based on the user display format in order to be more consistent. Please let me know if this works better for you.
The implementation is more sophisticated than the code I suggested in #note-3. However, it needs a slight fix. The value of
:initials
for:lastname_firstname
should be'#{lastname.to_s.first}#{firstname.to_s.first}'
(remove the space between the two characters).
Thanks for pointing this out, I will update the patch accordingly.