Add regex for follows from pleromabe

This commit is contained in:
eal 2017-08-24 21:53:31 +03:00
parent 8778270381
commit 5bd6abc134

View File

@ -121,6 +121,7 @@ export const statusType = (status) => {
return 'deletion' return 'deletion'
} }
// TODO change to status.activity_type === 'follow' when gs supports it
if (status.text.match(/started following/)) { if (status.text.match(/started following/)) {
return 'follow' return 'follow'
} }
@ -275,7 +276,8 @@ const addNewStatuses = (state, { statuses, showImmediately = false, timeline, us
}, },
'follow': (status) => { 'follow': (status) => {
let re = new RegExp(`started following ${user.name} \\(${user.statusnet_profile_url}\\)`) let re = new RegExp(`started following ${user.name} \\(${user.statusnet_profile_url}\\)`)
if (status.text.match(re)) { let repleroma = new RegExp(`started following ${user.screen_name}$`)
if (status.text.match(re) || status.text.match(repleroma)) {
addNotification({ type: 'follow', status: status, action: status }) addNotification({ type: 'follow', status: status, action: status })
} }
}, },