Merge branch 'feat/make-mentions-use-internal-routing' into 'develop'

Fix #289 Make more user links use internal routing

Closes #289

See merge request pleroma/pleroma-fe!500
This commit is contained in:
lambda 2019-01-30 17:46:18 +00:00
commit 7b0e3dc471
4 changed files with 88 additions and 3 deletions

View file

@ -0,0 +1,9 @@
export const mentionMatchesUrl = (attention, url) => {
if (url === attention.statusnet_profile_url) {
return true
}
const [namepart, instancepart] = attention.screen_name.split('@')
const matchstring = new RegExp('://' + instancepart + '/.*' + namepart + '$', 'g')
return !!url.match(matchstring)
}