Capture clicks on statuses to hijack mention clicks, match mention href to user somehow
This commit is contained in:
parent
3cfbf0141f
commit
15603981f8
4 changed files with 88 additions and 3 deletions
9
src/services/mention_matcher/mention_matcher.js
Normal file
9
src/services/mention_matcher/mention_matcher.js
Normal 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)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue