aboutsummaryrefslogtreecommitdiff
path: root/src/services/mention_matcher/mention_matcher.js
blob: 2c1ed9706459c2f6773ecc8def8d5c0251546294 (plain)
1
2
3
4
5
6
7
8
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)
}