<<< Previous |  | Next >>>

# mail::account::saveFolderIndexInfo

## Name

mail::account::saveFolderIndexInfo -- Update message status

## 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->`saveFolderIndexInfo``(size_t `messageNum`, const messageInfo &`msgInfo`, myCallback &`callback`);`

## USAGE

`mail::account::saveFolderIndexInfo` changes the status of a message. `messageNum` must be between zero and one less than the return code from mail::account::getFolderIndexSize(3x). `msgInfo` contains the new status flags for this message. See mail::account::getFolderIndexInfo(3x) for a description of message status flags.

NOTE: | The `uid` field in `msgInfo` is ignored. The message is specified by `messageNum`, and unique IDs of existing messages cannot be changed.

## 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.

NOTE: | 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.

NOTE:

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 `callback.fail`, or the request completing (`callback.success` invoked) but without invoking any callback function that refer to the message.

## SEE ALSO

mail::account::removeMessages(3x), mail::account::updateFolderIndexFlags(3x), mail::account::updateFolderIndexInfo(3x), mail::account::getFolderIndexInfo(3x).

<<< Previous | Home | Next >>>
mail::account::resume | Up | mail::account::searchMessages