Class Store.

Inherits Command

Alters message flags (RFC 3501 section 6.4.6) or annotations (RFC 5257).

The Store command is the principal means of altering message flags, although Append may be able to do the same.

The Store object uses setGroup() to allow parallel processing of several STORE commands. If the client (incorrectly) sends two conflicting commands, e.g. "store 1:* +flags.silent x" and by "store 1 -flags.silent x", the commands may be executed in any order, and the x flag on message 1 may have any value afterwards. Generally, the second command's finished last, because of how the database does locking.

Store::Store( IMAP * imap, const IntegerSet & set, bool silent, Transaction * transaction )

Constructs a Store handler which will use transaction to set the "\seen" flag for the messages in set within the mailbox currently selected by imap, and emit flag updates iff silent is false.

This is basically a helper for Fetch, which occasionally needs to set "\seen" implicitly. It doesn't have a tag(), so it won't send any tagged final response.

Store::Store( bool u )

Constructs a Store handler. If u is set, the first argument is presumed to be a UID set, otherwise it's an MSN set.

bool Store::addFlags()

Adds all the necessary flags to the database. Returns true if it sends any queries.

EString Store::entryName()

As listMailbox(), but ASCII only. Checks that and emits an error if necessary.

void Store::execute()

Stores all the annotations/flags, using potentially enormous numbers of database queries. The command is kept atomic by the use of a Transaction.

Reimplements Command::execute().

void Store::parseAnnotationEntry()

Parses and stores a single annotation entry for later processing. Leaves the cursor on the following character (space/paren).

bool Store::processAnnotationNames()

Persuades the database to know all the annotation entry names we'll be using.

bool Store::processFlagNames()

Adds any necessary flag names to the database and returns true once everything is in order.

bool Store::removeFlags( bool opposite )

Removes the specified flags from the relevant messages in the database. If opposite, removes all other flags, but leaves the specified flags.

Returns true if it enqueues a query and false if it does not.

This is a not ideal for the case where a single flag is removed from a single messages or from a simple range of messages. In that case, we could use a PreparedStatement. Later.

void Store::replaceAnnotations()

Replaces one or more annotations with the provided replacements.

bool Store::replaceFlags()

Ensures that the specified flags, and no others, are set for all the specified messages.

This web page based on source code belonging to The Archiveopteryx Developers. All rights reserved.