Name

mail::account::updateFolderIndexInfo — Update status of the currently open folder

Synopsis




#include <libmail/mail.H>


class myCallback : public mail::callback {
public:
    void success(std::string msg);
    void fail(std::string msg);
};


mail::account *account;

account->updateFolderIndexInfo( myCallback &callback);
 

USAGE

This function requests that the status of the currently open folder be updated. Messages marked as deleted are removed. The application will also be notified about changes to the folder made by any other application that has the same folder opened.

This request invokes methods in the currently opened folder's mail::callback::folder object, as follows:

  • The mail::account::messageChanged method is invoked for all messages which have an updated status flag set.

  • mail::account::messagesRemoved is invoked for all messages removed from the folder (those that were marked as deleted by this application and those that were removed from the folder by any other application that has this folder opened).

  • mail::account::newMessages is invoked if any messages were added to this folder. The application should use mail::account::getFolderIndexSize(3x), and compare it to the previously-known folder size, in order to determine how many messages were added to the folder (new messages are always added to the end of the message list).

Return Codes

The application must wait until callback's success or fail method is invoked. The success method is invoked when this request is succesfully processed. The fail method is invoked if this request cannot be processed. The application must not destroy callback until either the success or fail method is invoked.

Note

callback's fail method may be invoked even after other callback methods were invoked. This indicates that the request was partially completed before the error was encountered.