FriendsOfFlarum / byobu

Well integrated, advanced private discussions for your Flarum forum.
https://discuss.flarum.org/d/4762-flagrow-by-bu-well-integrated-advanced-private-discussions
MIT License
54 stars 33 forks source link

Please show display name instead of username #179

Closed verement closed 1 year ago

verement commented 1 year ago

Feature Request

Is your feature request related to a problem? Please describe.

When viewing a user’s profile, the Controls menu shows an option like “Send username a message” which includes the user’s actual username. On a site that uses nicknames and where users do not control their own username, this username can be very unfriendly and meaningless.

Describe the solution you'd like

Please show the user’s display name instead of their username:

diff --git a/vendor/fof/byobu/js/src/forum/extend/User.js b/vendor/fof/byobu/js/src/forum/extend/User.js
--- a/vendor/fof/byobu/js/src/forum/extend/User.js
+++ b/vendor/fof/byobu/js/src/forum/extend/User.js
@@ -47,7 +47,7 @@ function message() {
               });
             },
           },
-          app.translator.trans('fof-byobu.forum.buttons.send_pd', { username: user.username() })
+          app.translator.trans('fof-byobu.forum.buttons.send_pd', { username: user.displayName() })
         )
       );
     }

Since the display name can be the same as the username depending on admin configuration, this should present no change for sites that do use the username as the display name.

Describe alternatives you've considered

None.

luceos commented 1 year ago

Hey @verement, that's great.

As you narrowed down the issue can you perhaps also provide the pull request? You can do this from GitHub as well.