<commit_before>package br.com.caelum.brutal.infra;

import br.com.caelum.brutal.dao.FlaggableDAO;
import br.com.caelum.brutal.dao.InformationDAO;
import br.com.caelum.brutal.model.LoggedUser;
import br.com.caelum.vraptor.Result;
import br.com.caelum.vraptor.ioc.Component;

@Component
public class MenuInfo {
	
	private final Result result;
	private final LoggedUser loggedUser;
	private final FlaggableDAO flaggables;
	private final InformationDAO informations;

	public MenuInfo(Result result, LoggedUser loggedUser, InformationDAO informations, FlaggableDAO flaggables) {
		this.result = result;
		this.loggedUser = loggedUser;
		this.informations = informations;
		this.flaggables = flaggables;
	}
	
	public void include() {
		result.include("currentUser", loggedUser);
		if (loggedUser.canModerate()) {
			Long pendingCount = informations.pendingCount();
			int flaggedCount = flaggables.flaggedButVisibleCount();
			result.include("pendingForModeratorCount", pendingCount + flaggedCount);
		}
	}

}<commit_msg>Usuários com mais de 2000 pontos não podem ver contagem das abas de flagged.<commit_after>package br.com.caelum.brutal.infra;

import br.com.caelum.brutal.dao.FlaggableDAO;
import br.com.caelum.brutal.dao.InformationDAO;
import br.com.caelum.brutal.model.LoggedUser;
import br.com.caelum.vraptor.Result;
import br.com.caelum.vraptor.ioc.Component;

@Component
public class MenuInfo {
	
	private final Result result;
	private final LoggedUser loggedUser;
	private final FlaggableDAO flaggables;
	private final InformationDAO informations;

	public MenuInfo(Result result, LoggedUser loggedUser, InformationDAO informations, FlaggableDAO flaggables) {
		this.result = result;
		this.loggedUser = loggedUser;
		this.informations = informations;
		this.flaggables = flaggables;
	}
	
	public void include() {
		result.include("currentUser", loggedUser);
		if (loggedUser.canModerate()) {
			Long pendingCount = informations.pendingCount();
			int flaggedCount = flaggables.flaggedButVisibleCount();
			if (loggedUser.isModerator()) {
				result.include("pendingForModeratorCount", pendingCount + flaggedCount);
			} else {
				result.include("pendingForModeratorCount", pendingCount);
			}
		}
	}

}
{'fraction_non_alphanumeric': 0.09728506787330317, 'fraction_numerical': 0.0018099547511312218, 'mean_word_length': 5.317142857142857, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4507379', 'n_tokens_mistral': 786, 'n_tokens_neox': 738, 'n_words': 148}