Example #1
0
bool qm::AutoPilot::UnseenCountUpdater::updateAccount(Account* pAccount)
{
	if (wcscmp(pAccount->getClass(), L"mail") != 0)
		return false;
	
	SubAccount* pSubAccount = pAccount->getCurrentSubAccount();
	const WCHAR* pwszAddress = pSubAccount->getSenderAddress();
	if (!pwszAddress || !*pwszAddress)
		return false;
	
	unsigned int nCount = 0;
	if (pSubAccount->getPropertyInt(L"Global", L"ShowUnseenCountOnWelcome")) {
		Folder* pFolder = pAccount->getFolderByBoxFlag(Folder::FLAG_INBOX);
		if (pFolder)
			nCount = pFolder->getUnseenCount();
	}
	(*pfnSHSetUnreadMailCount_)(pwszAddress, nCount, wstrPath_.get());
	
	return true;
}