Centralize logic that decides whether a display name can be shown. (#508)