refactor: decode punycode domains for the UI #7748
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
The function
getAcct
is improved by agetAcctUi
function. It returns a Unicode version of the domain name, instead of the punycode version. Also theacct
function, which was only an alias forgetAcct
is refactored and removed. It was left over from the Vue3 migration.There are a few places where
getAcct
is not replaced (yet):src/client/components/post-form.vue
&src/client/ui/chat/post-form.vue
uses account name in a post, will MFM decode IDNs correctly? if so
getAcct
should also be replaced withgetAcctUi
here because the user name is show to the user.src/client/pages/my-antennas/editor.vue
will antennas correctly recognize IDNs?
src/server/api/limiter.ts
This could put IDNs in log files. Does the database, log and syslog protocol all support Unicode for this? And should IDNs be used here?
Why
Punycode was not always decoded in the user interface. For example:
old screenshot
new screenshot
Additional info
related: #5826