Exemplo n.º 1
0
/**\brief Updates the HUD
 */
void Hud::Update( void ) {
	int j;
	list<AlertMessage> toDelete;
	list<AlertMessage>::iterator i;
	for( i= AlertMessages.begin(), j=1; i != AlertMessages.end(); ++i,++j ){
		if(MessageExpired(*i))
			toDelete.push_back(*i);
	}
	for( i= toDelete.begin(); i != toDelete.end(); ++i ){
		AlertMessages.remove(*i);
	}
}
Exemplo n.º 2
0
/**\brief Updates the HUD
 */
void Hud::Update( void ) {
	int j;
	list<AlertMessage> toDelete;
	list<AlertMessage>::iterator i;
	for( i= AlertMessages.begin(), j=1; i != AlertMessages.end(); ++i,++j ){
		if(MessageExpired(*i))
			toDelete.push_back(*i);
	}
	for( i= toDelete.begin(); i != toDelete.end(); ++i ){
		AlertMessages.remove(*i);
	}
	for( j = 0; j< MAX_STATUS_BARS; j++){
		if( Bars[j] != NULL ) {
			Bars[j]->Update();
		}
	}
}
Exemplo n.º 3
0
/***********************************************************************************
 ** React to text input from the server in reply to this command
 **
 ** PopCommands::Uidl::OnInput
 ***********************************************************************************/
OP_STATUS PopCommands::Uidl::OnUIDL(int server_id, const OpStringC8& uidl, POP3& connection)
{
	message_gid_t existing        = connection.GetBackend().GetUIDLManager().GetUIDL(uidl);
	BOOL          complete        = FALSE;
	BOOL          leave_on_server = connection.GetBackend().GetAccountPtr()->GetLeaveOnServer();
	BOOL          force_fetch     = connection.ShouldFetchUIDL(uidl);

	Message message;
	if (OpStatus::IsSuccess(connection.GetBackend().GetMessageDatabase().GetMessage(existing, FALSE, message)))
		complete = !message.IsFlagSet(Message::PARTIALLY_FETCHED);

	if ((complete && !leave_on_server) ||
		MessageExpired(uidl,connection)|| /* if date is older than X days */
		connection.ShouldRemoveUIDL(uidl))
	{
		// This message should be removed from the server
		RETURN_IF_ERROR(AddMessageToCommand(m_dele_command, server_id, uidl));
	}
	else if (!existing || force_fetch)
	{
		// Message should be fetched. Check if we want to fetch the full message
		BOOL fetch_full = force_fetch || !connection.GetBackend().GetAccountPtr()->GetLowBandwidthMode();

		// Remove message from server if we don't need it after this
		if (!leave_on_server && fetch_full)
			RETURN_IF_ERROR(AddMessageToCommand(m_dele_command, server_id, uidl));

		// Fetch the message
		if (fetch_full)
		{
			RETURN_IF_ERROR(AddMessageToCommand(m_retr_command, server_id, uidl));
		}
		else
		{
			RETURN_IF_ERROR(AddMessageToCommand(m_top_command, server_id, uidl));
			m_top_command->SetLinesToFetch(connection.GetBackend().GetAccountPtr()->GetFetchMaxLines());
		}

		// Run a LIST command to get the size
		if (!m_list_command)
		{
			m_list_command = OP_NEW(PopCommands::List, ());
			RETURN_IF_ERROR(SetNextCommand(m_list_command));
		}
Exemplo n.º 4
0
/**\brief Updates the HUD
 */
void Hud::Update( lua_State *L ) {
	int j;
	list<AlertMessage>::iterator i;

	i = AlertMessages.begin();
	while( i != AlertMessages.end() ) {
		bool messageExpired = MessageExpired(*i);

		if(messageExpired) {
			AlertMessages.erase(i++);
		} else {
			++i;
		}
	}

	for( j = 0; j < MAX_STATUS_BARS; j++) {
		if( Bars[j] != NULL ) {
			Bars[j]->Update( L );
		}
	}
}