HomePhabricator
Diffusion Comm 87417b194198

[lib/web/native] Bold ENS names in user mentions

Description

[lib/web/native] Bold ENS names in user mentions

Summary:
Now that the regex in D10388 (previous diff) can support ENS names in @ mentions, we need to make some modifications to createMemberMapForUserMentions since it constructs a member map that is used to bold mentions.

For example, since the map will link a username (john) to a user ID (92019), when we type @john, we associate it to the user ID.

For ENS names, we want to do the same. We want to have both the wallet address and the resolved ENS name mapping to the same user ID, so we attempt to insert both.

This way, for a ENS user whose name is jack.eth, the members map will have two entries mapping to the same user ID value.

Addresses https://linear.app/comm/issue/ENG-5075/ensure-web-and-native-detect-ens-names-and-bold-them-for-markdown

Depends on D10388

Test Plan:
Please see the videos below where I test on web and native

web

native

Reviewers: atul, ginsu, inka

Reviewed By: inka

Subscribers: ashoat, tomek

Differential Revision: https://phab.comm.dev/D10389

Details

Provenance
rohanAuthored on Dec 18 2023, 12:00 PM
Reviewer
inka
Differential Revision
D10389: [lib/web/native] Bold ENS names in user mentions
Parents
rCOMMc97013f91e24: [lib] Modify markdownUserMentionRegex to match ENS names as well
Branches
Unknown
Tags
Unknown