public static bool DetectSpam(this Topic topic) { var member = ApplicationContext.Current.Services.MemberService.GetById(topic.MemberId); topic.IsSpam = SpamChecker.IsSpam(member, string.Format("{0} {1}", topic.Title, topic.Body)); return(topic.IsSpam); }
public static bool DetectSpam(this Comment comment) { var member = ApplicationContext.Current.Services.MemberService.GetById(comment.MemberId); comment.IsSpam = SpamChecker.IsSpam(member, comment.Body); return(comment.IsSpam); }