Skip to content
Snippets Groups Projects
Commit ca91af7f authored by dakkar's avatar dakkar
Browse files

merge: fix: make sure outgoing remote mentions get resolved correctly if...

merge: fix: make sure outgoing remote mentions get resolved correctly if referenced with non-canonical casing (!711)

View MR for information: TransFem-org/Sharkey!711



Closes #646

Approved-by: default avatardakkar <dakkar@thenautilus.net>
Approved-by: default avatarMarie <github@yuugi.dev>
parents 4fed3555 ff220bd3
No related branches found
No related tags found
No related merge requests found
...@@ -412,7 +412,7 @@ export class MfmService { ...@@ -412,7 +412,7 @@ export class MfmService {
mention: (node) => { mention: (node) => {
const a = doc.createElement('a'); const a = doc.createElement('a');
const { username, host, acct } = node.props; const { username, host, acct } = node.props;
const remoteUserInfo = mentionedRemoteUsers.find(remoteUser => remoteUser.username === username && remoteUser.host === host); const remoteUserInfo = mentionedRemoteUsers.find(remoteUser => remoteUser.username.toLowerCase() === username.toLowerCase() && remoteUser.host?.toLowerCase() === host?.toLowerCase());
a.setAttribute('href', remoteUserInfo a.setAttribute('href', remoteUserInfo
? (remoteUserInfo.url ? remoteUserInfo.url : remoteUserInfo.uri) ? (remoteUserInfo.url ? remoteUserInfo.url : remoteUserInfo.uri)
: `${this.config.url}/${acct.endsWith(`@${this.config.url}`) ? acct.substring(0, acct.length - this.config.url.length - 1) : acct}`); : `${this.config.url}/${acct.endsWith(`@${this.config.url}`) ? acct.substring(0, acct.length - this.config.url.length - 1) : acct}`);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment