Best practice to avoid “add friend” abuse

别等时光非礼了梦想. 提交于 2019-12-04 14:04:37

Sounds to me like the best option. To simplify, I'd probably send out the email if the record exists at all (instead of checking based on a timestamp), and then set up a cron to systematically dispose of the old ones - that way you can have a bit more control over the time limits (your "limiting" logic would go into the cron script, so you could decide whether to remove the records or not based on more complicated parameters than just a timestamp - e.g. don't remove the record if a particular user has a large amount of activity, to stop spammers. You could even be user or account-type specific, but I do have a tendency to go overboard...)

As far as I can tell, Facebook has "Add Friend" -> "Pending request". From there, you can't do anything until the other person responds, so you can't spam requests at all, but I guess that depends if you require confirmation on the other end, and it's subject to your own tastes.

I think it's best that you make the add friend option a two way thing. So the first user invites someone else to be his/her friend (changing the "add friend"-link into something like "invited" which is not a link). The other person then has to accept the first user as a friend. After that both of the users can delete the friendship, but after that, if one of them decides to be friends again he can invite the other one again. You can put some sort of validity-period to this invitation of course, or some limitations (ie. one can only invite someone else three times)...

This way you won't be spamming users with emails (at least because some clicks a link too often), and people have a bit more control over who they are friends with. Of course, this approach does have some downsides (like what to do with ignored invitations, etc..).

The way you describe in your question I think is also a good way of fighting spam, you can also do something like limiting the number of times someone can add another user as a friend (ie once per day, three times a week, I don't know, something like that)..

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!