Page MenuHomePhabricator

More hooks for user's picture and display name
Open, Needs TriagePublicFeature


Feature summary (what you would like to be able to do and where):

  • Add more hooks to make it possible to implement nickname/display name/realname/a.k.a for extension developers.
  • Add more hooks to make it possible to implement user's picture/icon/profile image for extension developers.

Use case(s) (list the steps that you performed to discover that problem, and describe the actual underlying problem which you want to solve. Do not describe only a solution):
I remember archived Extension:Realnames which displays a user's real name. It replaced names in the final HTML output because it was only way to achive it.

Benefits (why should this be implemented?):
A change of core is hard to be discussed and decided. (see T154177) There are many problems make it hard to get the features on Wikipedias. But it should not discourage third party's activity. Some wikis are private, some wikis already accept a sort of social features in a hacky way. If the hacky ways can be improved, why don't we?

Event Timeline

Add more hooks to make it possible to implement user's picture/icon/profile image for extension developers.

Just what do you mean by this, though? SocialProfile, a(n essential) part of the Social-Tools family, does exactly this (and a lot more), thus proving that it's already feasible to do this with given MW core features.

Of course it's worth noting that SocialProfile only displays the user's avatar image on User:/UserWiki:/User_profile: pages by default, but it makes the underlying architecture (the wAvatar PHP class) available for any and all other social tools and other extensions which may, if they so desire, choose to implement avatars using the same shared architecture. When $wgUserProfileAvatarsInDiffs = true; is set, avatars are shown on diff views (rendered by MW core), provided that no-one is gonna rip the hooks used by the SocialProfile feature out of MW core.
Thus on a very "social" wiki like Brickipedia, you'll see avatars in many places besides the aforementioned namespaces.

For individual skins like Timeless there are tickets like T258994/T282578, and, speaking as a skin developer and maintainer of several of them, feature requests are always welcome, and patches are even better!

Thank you @ashley for responding to me. I've inspected SocialProfile, especially how $wgUserProfileAvatarsInDiffs works after checking your comment.

I will still say though, that this ticket is valid and SocialProfile, fortunately, could modify the diff page as DifferenceEngineOldHeader Hook allows to modify $oldHeader. On the other hand, For instance of the history action, HistoryAction and HistoryPager classes do not give a chance of appending/prepending an HTML tag to the username. (It seems to be possible to modify $s of PageHistoryLineEnding hook using a regular expression, but it is another topic)

In another aspect, it seems to be too hard for implementing every hook to modify all appearances of usernames. I think the name of hook I want would be, say, 'HtmlUserAsInterfaceLinkRendererBegin'. It should only affect links that link to user pages and be on an interface to prevent modification of the content of the wiki articles.