new Message(jmap, id, blobId, threadId, mailboxIds, optsopt)
This class represents a JMAP Message.
When creating a new Message instance, the following requirements must be met:
- The threadId must be defined (in JMAP, a Message is always in a Thread)
- The mailboxIds must contain at least one element.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
jmap |
Client | The Client instance that created this Message. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
id |
String | The unique identifier of this Message. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
blobId |
String | The identifier representing the raw [@!RFC5322] message. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
threadId |
String | The unique identifier of the Thread this Message is in. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
mailboxIds |
Array.<String> | The array of Mailbox identifiers this Message is present into. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
opts |
Object |
<optional> |
The optional properties of this Message. Properties
|
- Source:
- See:
Extends
Methods
(static) fromJSONObject(jmap, object) → {Message}
Creates a Message from its JSON representation.
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
jmap |
Client | The Client instance passed to the Message constructor. |
|||||||||||||||
object |
Object | The JSON representation of the Message, as a Javascript object. Properties
|
- Source:
Returns:
- Type
- Message
destroy() → {Promise}
Destroy this Message on the server.
- Source:
- See:
Returns:
A Promise, as per Client.destroyMessage.
- Type
- Promise
move(mailboxIds) → {Promise}
Moves this Message to a different set of mailboxes.
Parameters:
Name | Type | Description |
---|---|---|
mailboxIds |
Array.<String> | The identifiers of the target mailboxes for the message. |
- Source:
- See:
Returns:
A Promise, as per Client.moveMessage.
- Type
- Promise
moveToMailboxWithRole(role) → {Promise}
Moves this Message to the mailbox holding the given role
.
This will first do a JMAP request to find the mailbox with the given role, then a Message#move to move the message.
Parameters:
Name | Type | Description |
---|---|---|
role |
MailboxRole | String | The desired mailbox role. |
- Source:
- See:
Returns:
A Promise, as per Message#move.
- Type
- Promise
setIsAnswered(isAnswered) → {Promise}
Updates the isAnswered field of this Message.
Parameters:
Name | Type | Description |
---|---|---|
isAnswered |
Boolean | The isAnswered field of the message. |
- Source:
- See:
Returns:
A Promise, as per Client.updateMessage.
- Type
- Promise
setIsFlagged(isFlagged) → {Promise}
Updates the isFlagged field of this Message.
Parameters:
Name | Type | Description |
---|---|---|
isFlagged |
Boolean | The isFlagged field of the message. |
- Source:
- See:
Returns:
A Promise, as per Client.updateMessage.
- Type
- Promise
setIsUnread(isUnread) → {Promise}
Updates the isUnread field of this Message.
Parameters:
Name | Type | Description |
---|---|---|
isUnread |
Boolean | The isUnread field of the message. |
- Source:
- See:
Returns:
A Promise, as per Client.updateMessage.
- Type
- Promise
update(options) → {Promise}
Updates this Message.
Parameters:
Name | Type | Description |
---|---|---|
options |
Object | The options to be updated in this Message as per Client.updateMessage. |
- Source:
- See:
Returns:
A Promise, as per Client.updateMessage.
- Type
- Promise