Default avatar from Name & not from Username

Is there a way with which we can change the generation of default avatar from username to user’s full names?
Many of our users have numerical usernames or their usernames start with a certain character (like P, R).

I don’t think there is any way to do that at this time.

1 Like

Is there any way we could hack into it? Probably by forking the Discourse repo and merging whenever there is an update? Or can it be achieved by writing a plugin?

1 Like

Maintaining a long term fork is generally discouraged.

Probably you could do this as a plugin or by submitting a PR that adds this option as a Site Setting.

I would start with the latter as its probably easier and likely a pretty small change (though I could be wrong).

Whatever you learn in doing so will be helpful in developing it as a plugin if it’s not accepted into core for some reason.

4 Likes

Any idea/pointers where should I start looking to modify this behavior and add a setting?

I would just start grepping the code base for “avatar” and see if you can find where the letter avatar is currently generated…

Then search for “SiteSetting” and see how other site settings are implemented.

If you get stuck, let us know and I can take a closer look.