MojErr SearchFolderCommand::HandleSearchResponse()
{
	CommandTraceFunction();

	try {
		m_searchResponseParser->CheckStatus();

		int limit = m_searchRequest->GetLimit();
		int found = m_matchingUIDs.size();

		sort(m_matchingUIDs.begin(), m_matchingUIDs.end());

		if (limit > 0 && found > limit) {
			MojLogInfo(m_log, "search results: %d emails found (limiting to %d)", found, limit);

			m_matchingUIDs.erase(m_matchingUIDs.begin(), m_matchingUIDs.end() - limit);
		} else {
			MojLogInfo(m_log, "search results: %d emails found", m_matchingUIDs.size());
		}

		RequestHeaders();
	} CATCH_AS_FAILURE

	return MojErrNone;
}
Example #2
0
std::string HttpHeaders::Headers()
{
	if ( code_ == "" )
		return RequestHeaders();
	else
		return ResponseHeaders();
}