Class: MessageList

MessageList

new MessageList(jmap, optsopt)

This class represents a JMAP MessageList.

Parameters:
Name Type Attributes Description
jmap Client

The Client instance that created this Mailbox.

opts Object <optional>

The optional properties of this Mailbox.

Properties
Name Type Attributes Default Description
accountId String <optional>
''

The id of the Account used in the request that originated this MessageList.

filter Object <optional>
null

The filter used in the request that originated this MessageList.

sort Object <optional>
null

The sort properties used in the request that originated this MessageList.

collapseThreads Boolean <optional>
false

The collapseThreads value used in the request that originated this MessageList.

position Number <optional>
0

The 0-based index of the first result in the threadIds array within the complete list.

total Number <optional>
0

The total number of messages in the message list (given the filter and collapseThreads arguments).

threadIds Array.<String> <optional>
[]

The list of Thread identifiers for each message in the list after filtering, sorting and collapsing threads.

messageIds Array.<String> <optional>
[]

The list of Message identifiers for each message in the list after filtering, sorting and collapsing threads.

Source:
See:

Extends

Methods

(static) fromJSONObject(jmap, object) → {MessageList}

Creates a MessageList from its JSON representation.

Parameters:
Name Type Description
jmap Client

The Client instance passed to the MessageList constructor.

object Object

The JSON representation of the MessageList, as a Javascript object.

Source:
Returns:
Type
MessageList

getMessages(optionsopt) → {Promise}

Fetches all messages contained in this MessageList.
This will delegate to Client#getMessages, passing this MessageList's messageIds as the ids option.

Parameters:
Name Type Attributes Description
options Object <optional>

The options object passed to Client#getMessages. Please note that the ids option will be overriden if defined.

Source:
See:
Returns:

A promise that eventually resolves with an array of Message instances.

Type
Promise

getThreads(optionsopt) → {Promise}

Fetches all threads contained in this MessageList.
This will delegate to Client#getThreads, passing this MessageList's threadIds as the ids option.

Parameters:
Name Type Attributes Description
options Object <optional>

The options object passed to Client#getThreads. Please note that the ids option will be overriden if defined.

Source:
See:
Returns:

A promise that eventually resolves with an array of Thread instances.

Type
Promise