C# Class Subtext.Framework.CommentFilter

Class used to filter incoming comments. This will get replaced with a plugin once the plugin architecture is complete, but the logic will probably get ported.
Inheritance: ICommentFilter
Afficher le fichier Open project: ayende/Subtext Class Usage Examples

Méthodes publiques

Méthode Description
ClearCommentCache ( ) : void

Clears the comment cache.

CommentFilter ( Cache cache ) : System

Initializes a new instance of the CommentFilter class.

FilterAfterPersist ( FeedbackItem feedbackItem ) : void

Filters the comment. Throws an exception should the comment not be allowed. Otherwise returns true. This interface may be changed.

The first filter examines whether comments are coming in too quickly from the same SourceUrl. Looks at the BlogInfo.CommentDelayInMinutes.

The second filter checks for duplicate comments. It only looks at the body of the comment.

FilterBeforePersist ( FeedbackItem feedback ) : void

Validates the feedback before it has been persisted.

Private Methods

Méthode Description
FlagAsSpam ( FeedbackItem feedbackItem ) : void
IsDuplicateComment ( FeedbackItem feedbackItem ) : bool
SourceFrequencyIsValid ( FeedbackItem feedbackItem ) : bool

Method Details

ClearCommentCache() public méthode

Clears the comment cache.
public ClearCommentCache ( ) : void
Résultat void

CommentFilter() public méthode

Initializes a new instance of the CommentFilter class.
public CommentFilter ( Cache cache ) : System
cache Cache
Résultat System

FilterAfterPersist() public méthode

Filters the comment. Throws an exception should the comment not be allowed. Otherwise returns true. This interface may be changed.

The first filter examines whether comments are coming in too quickly from the same SourceUrl. Looks at the BlogInfo.CommentDelayInMinutes.

The second filter checks for duplicate comments. It only looks at the body of the comment.

public FilterAfterPersist ( FeedbackItem feedbackItem ) : void
feedbackItem Subtext.Framework.Components.FeedbackItem Entry.
Résultat void

FilterBeforePersist() public méthode

Validates the feedback before it has been persisted.
Thrown if too many comments are received from the same source in a short period. Thrown if the blog does not allow duplicate comments and too many are received in a short period of time.
public FilterBeforePersist ( FeedbackItem feedback ) : void
feedback Subtext.Framework.Components.FeedbackItem
Résultat void