Class Session.

Inherits Garbage. Inherited by ImapSession.

This class contains all data associated with the single use of a Mailbox, such as the number of messages visible, etc. Subclasses provide some protocol-specific actions.

Session::Session( Mailbox * m, Connection * c, bool readOnly )

Creates a new Session for the Mailbox m tied to Connection c. If readOnly is true, the session is read-only.

void Session::abort()

Aborts this Session. The default implementation disconnects the client, subclasses may be more subtle.

void Session::addRecent( uint uid )

Marks the message uid as "\Recent" in this session.

void Session::addRecent( uint start, uint num )

Marks num messages with uid starting at start as "\Recent" in this session.

void Session::addUnannounced( const IntegerSet & s )

Records that the messages in s have been added to the mailbox or changed, and should be announced to the client and if necessary added to the session.

void Session::addUnannounced( uint uid )

Records that uid has been added to the mailbox or changed, and should be announced to the client and if necessary added to the session.

bool Session::allows( Permissions::Right r )

Returns true only if this session knows that its user has the right r. If the session does not know, or the user doesn't have the right, it returns false.

void Session::clearExpunged( uint uid )

Records that the client has been told that uid no longer exists.

This is IMAP stuff infesting Session.

void Session::clearUnannounced()

Records that everything in unannounced() has been announced.

Connection * Session::connection() const

Returns a pointer to the Connection served by this Session.

uint Session::count() const

Returns the number of messages visible in this session.

void Session::emitUpdates( Transaction * t )

This virtual function is responsible for telling the client about any updates it need to hear. If t is non-null and any database work is needed, it should use a subtransaction of t.

void Session::end()

Ensures that the Mailbox will not keep this object alive.

void Session::expunge( const IntegerSet & uids )

Records that uids has been expunged and that the clients should be told about it at the earliest possible moment.

const IntegerSet & Session::expunged() const

Returns a message set containing all the UIDs that have been expunged in the database, but not yet reported to the client.

bool Session::initialised() const

Returns true if this Session has updated itself from the database.

bool Session::isEmpty() const

Returns true if this session is known to contain no messages (ie. both messages() and unannounced() return empty sets), and true if the mailbox is nonempty or its count is not known.

bool Session::isRecent( uint uid ) const

Returns true only if the message uid is marked as "\Recent" in this session.

uint Session::largestUid() const

Returns the UID of the highest-numbered message, or uidnext()-1 if the mailbox is empty, or 1 if uidnext() is 1.

Mailbox * Session::mailbox() const

Returns a pointer to the currently selected Mailbox, or 0 if there isn't one.

const IntegerSet & Session::messages() const

Returns a message set containing all the messages that are currently valid in this session. This may include expunged messages.

uint Session::msn( uint uid ) const

Returns the MSN of the message with UID uid, or 0 if there is no such message.

int64 Session::nextModSeq() const

Returns what setNextModSeq() set. The initial value is 0.

Permissions * Session::permissions() const

Returns a pointer to the Permissions object owned by this session, or 0 if none has been created (by Select). This object is ready to answer queries (with allows()) because Select waited for it to be.

bool Session::readOnly() const

Returns true if this is a read-only session (as created by EXAMINE), and false otherwise (SELECT).

IntegerSet Session::recent() const

Returns a IntegerSet containing all messages marked "\Recent" in this session.

void Session::sendFlagUpdate()

Does whatever is necessary to tell the client about new flags. This is really a hack for ImapSession.

void Session::setNextModSeq( int64 ms ) const

Records that the next possible modseq for a message in this session is ms or higher.

void Session::setPermissions( Permissions * p )

Sets the Permissions object for this session to p. Used only by Select. Session assumes that p is Permissions::ready().

void Session::setUidnext( uint u )

Sets our uidnext value to u. Used only by the SessionInitialiser.

uint Session::uid( uint msn ) const

Returns the UID of the message with MSN msn, or 0 if there is no such message.

uint Session::uidnext() const

Returns the next UID to be used in this session. This is the same as Mailbox::uidnext() most of the time. It can lag behind if the Mailbox has changed and this session hasn't issued the corresponding untagged EXISTS and UIDNEXT responses.

uint Session::uidvalidity() const

Returns the uidvalidity of the mailbox. For the moment, this is always the same as Mailbox::uidvalidity(), and both are always 1.

IntegerSet Session::unannounced() const

Returns whatever has been set using addUnannounced() and not yet cleared by clearUnannounced().

Session::~Session()

Exists to satisfy g++.

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