pub fn notification_wanted(comment: &CommentAddedData, settings: &OwnerSettings) -> IResult {
    let author = &comment.author_username;
    let owner = &comment.base.change_owner_username;

    if owner == author {
        return Err(NotificationRuleViolation::AuthorAndOwnerAreTheSame);
    }

    if settings.subscribe_comment == false {
        return Err(NotificationRuleViolation::OwnerNotSubscribedToComments(owner.clone()));
    }

    if settings.ignore_by_username.contains(author) {
        return Err(NotificationRuleViolation::OwnerIgnoresCommentsByUser(owner.clone(), author.clone()));
    }

    if settings.ignore_projects.contains(&comment.base.project) {
        return Err(NotificationRuleViolation::OwnerIgnoresCommentsForProject(owner.clone(), comment.base.project.clone()));
    }

    return Ok(());
}
/**
 * Only performs checks to verify that a comment notification should be created.
 */
Only performs checks to verify that a comment notification should be created.
Only performs checks to verify that a comment notification should be created .
pub fn notification_wanted(comment: &CommentAddedData, settings: &OwnerSettings) -> IResult {
    let author = &comment.author_username;
    let owner = &comment.base.change_owner_username;
    if owner == author {
        return Err(NotificationRuleViolation::AuthorAndOwnerAreTheSame);
    }
    if settings.subscribe_comment == false {
        return Err(NotificationRuleViolation::OwnerNotSubscribedToComments(owner.clone()));
    }
    if settings.ignore_by_username.contains(author) {
        return Err(NotificationRuleViolation::OwnerIgnoresCommentsByUser(owner.clone(), author.clone()));
    }
    if settings.ignore_projects.contains(&comment.base.project) {
        return Err(NotificationRuleViolation::OwnerIgnoresCommentsForProject(owner.clone(), comment.base.project.clone()));
    }
    return Ok(());
}
pub fn notification_wanted ( comment : & CommentAddedData , settings : & OwnerSettings ) -> IResult { let author = & comment . author_username ; let owner = & comment . base . change_owner_username ; if owner == author { return Err ( NotificationRuleViolation :: AuthorAndOwnerAreTheSame ) ; } if settings . subscribe_comment == false { return Err ( NotificationRuleViolation :: OwnerNotSubscribedToComments ( owner . clone ( ) ) ) ; } if settings . ignore_by_username . contains ( author ) { return Err ( NotificationRuleViolation :: OwnerIgnoresCommentsByUser ( owner . clone ( ) , author . clone ( ) ) ) ; } if settings . ignore_projects . contains ( & comment . base . project ) { return Err ( NotificationRuleViolation :: OwnerIgnoresCommentsForProject ( owner . clone ( ) , comment . base . project . clone ( ) ) ) ; } return Ok ( ( ) ) ; }
Only performs checks to verify that a comment notification should be created.
Only performs checks to verify that a comment notification should be created .
comment
&CommentAddedData
settings
&OwnerSettings
comment
&CommentAddedData
settings
&OwnerSettings