Update status of multiple messages


#include <libmail/mail.H>

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

account->updateFolderIndexFlags(const std::vector<size_t> msgList, bool doFlip, bool enableDisable, const messageInfo &msgInfo, myCallback &callback);


This is a version of mail::account::saveFolderIndexInfo(3x) that updates the status of multiple messages with one request.

msgList specifies a list of messages. Messages are numbered starting with message #0 and up to one less than mail::account::getFolderIndexSize(3x)() (when mail::account::getFolderIndexSize returns 6, the messages are numbered 0 through 5). Only the messages that appear in msgList are processed by this request.

msgInfo selects which message status flags should be updated in every message. See mail::account::getFolderIndexInfo(3x).

msgInfo does NOT specify the new value of the status flags, only which status flags should be updated. For example, setting msgInfo.marked to true indicates that the messages' marked status flag will be set to the value specified by doFlip and enableDisable.

Setting doFlip to true "flips" the selected status flags (each message's flag will be set to false if the status flag was originally true, and set to true if the status flag was originalfalse). If doFlip is false, then the selected status flags are set to the value of enableDisableenableDisable is ignored when Setting doFlip is true.

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.


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.


The application is notified about when a message's status changes by by invoking the messageChanged callback method of the currently opened folder's mail::folderCallback object. Depending on the mail server, the messageChanged method may be invoked as part of processing this request, or some time later after this request is completed, and callback's success method was invoked.


Multiple applications may have the same account and folder opened at the same time. It is possible that a message referenced by this request was already deleted by another application. Depending on the underlying server implementation this will result in either a failed request, invoking, or the request completing (callback.success invoked) but without invoking any callback function that refer to the message.

See Also

mail::account::saveFolderIndexInfo(3x), mail::account::getFolderIndexInfo(3x).


Sam Varshavchik


08/25/2016 Cone© Cone: COnsole Newsreader And E