Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
Merge pull request #2 from antimoz89/master
Browse files Browse the repository at this point in the history
Fixed "Bad username" filter bug and re-enabled it.
  • Loading branch information
thomas-daniels committed Sep 28, 2014
2 parents c347e15 + 94060a2 commit b3077eb
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions Phamhilator/PostChecker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ public static PostAnalysis CheckPost(Post post)
return info;
}

// TODO: Returning false positives, even when name dose not contain any blacklisted name terms.

//IsBadUsername(post, ref info);
IsBadUsername(post, ref info);

return info;
}
Expand Down Expand Up @@ -202,7 +200,7 @@ private static bool IsBadUsername(Post post, ref PostAnalysis info)
{
foreach (var whiteTerm in GlobalInfo.WhiteName.Terms[post.Site])
{
if (whiteTerm.Key.IsMatch(post.Title))
if (whiteTerm.Key.IsMatch(post.AuthorName))
{
info.Accuracy -= whiteTerm.Value;
info.WhiteTermsFound.Add(whiteTerm.Key, whiteTerm.Value);
Expand All @@ -215,7 +213,7 @@ private static bool IsBadUsername(Post post, ref PostAnalysis info)

foreach (var blackTerm in GlobalInfo.BlackName.Terms)
{
if (blackTerm.Key.IsMatch(post.Title))
if (blackTerm.Key.IsMatch(post.AuthorName))
{
info.Accuracy += blackTerm.Value;
info.BlackTermsFound.Add(blackTerm.Key, blackTerm.Value);
Expand Down

0 comments on commit b3077eb

Please sign in to comment.