diff options
| author | Shpuld Shpuldson <shp@cock.li> | 2021-03-01 09:27:19 +0200 |
|---|---|---|
| committer | Shpuld Shpuldson <shp@cock.li> | 2021-03-01 09:27:19 +0200 |
| commit | 35cde98d2c7b6edb458963effb3e40d36d1b3ebf (patch) | |
| tree | 0e824d880b53cd8f1c6213aad74d9817486904a6 /src/services/entity_normalizer/entity_normalizer.service.js | |
| parent | 44e687653cd79ca99950040c547a23e3a8a99c23 (diff) | |
| parent | 49aa10e1c0e279d692fb92695f92e4b8548f6b12 (diff) | |
Merge branch 'fix/punycode-buggy' into rc/2.3.0
Diffstat (limited to 'src/services/entity_normalizer/entity_normalizer.service.js')
| -rw-r--r-- | src/services/entity_normalizer/entity_normalizer.service.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/services/entity_normalizer/entity_normalizer.service.js b/src/services/entity_normalizer/entity_normalizer.service.js index 6ed663e1..9b2b30e6 100644 --- a/src/services/entity_normalizer/entity_normalizer.service.js +++ b/src/services/entity_normalizer/entity_normalizer.service.js @@ -203,7 +203,8 @@ export const parseUser = (data) => { output.rights = output.rights || {} output.notification_settings = output.notification_settings || {} - // Convert punycode to unicode + // Convert punycode to unicode for UI + output.screen_name_ui = output.screen_name if (output.screen_name.includes('@')) { const parts = output.screen_name.split('@') let unicodeDomain = punycode.toUnicode(parts[1]) @@ -211,7 +212,7 @@ export const parseUser = (data) => { // Add some identifier so users can potentially spot spoofing attempts: // lain.com and xn--lin-6cd.com would appear identical otherwise. unicodeDomain = '🌏' + unicodeDomain - output.screen_name = [parts[0], unicodeDomain].join('@') + output.screen_name_ui = [parts[0], unicodeDomain].join('@') } } |
