Zimlet JavaScript API Reference - ZmConv

Class ZmConv


Extends ZmMailItem.

This class represents a conversation, which is a collection of mail messages which have the same subject.

Defined in: ZmConv.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
ZmConv(id, list)
Creates a conversation.
Method Summary
Method Attributes Method Name and Description
 
addMsg(msg, index)
Adds the message at the given index.
<static>  
ZmConv.createFromDom(node, args)
Creates a conv from its JSON representation.
<static>  
ZmConv.createFromMsg(msg, args)
Creates a conv from msg data.
 
Gets a vector of addresses of the given type.
 
getFirstHotMsg(params, callback)
Gets the first relevant msg of this conv, loading the conv msg list if necessary.
 
Gets the mute/unmute icon.
 
Returns the number of unread messages in this conversation.
 
Gets the status tool tip.
 
hasFlag(flag, value)
Checks if any of the msgs within this conversation has the given value for the given flag.
 
hasMatchingMsg(search, defaultValue)
Checks if this conversation has a message that matches the given search.
 
Checks if the conversation is read only.
 
load(params, callback)
Ensures that the requested range of msgs is loaded, getting them from the server if needed.
 
loadMsgs(params, callback, batchCmd)
This method supports ZmZimletBase::getMsgsForConv.
 
removeMsg(msg)
Removes the message.
Methods borrowed from class ZmMailItem:
clear, getEmails, getReadIcon, ignoreJunkTrash
Methods borrowed from class ZmItem:
cache, canAddTag, create, deleteLocal, flagLocal, getById, getDefaultDndAction, getFolderId, getRestUrl, getTagImageFromIds, getTagImageInfo, hasTag, isShared, modify, move, moveLocal, removeAllTagsLocal, rename, setFlag, tagLocal
Methods borrowed from class ZmModel:
addChangeListener, removeAllChangeListeners, removeChangeListener
Class Detail
ZmConv(id, list)
Creates a conversation.
Parameters:
{int} id
a unique ID
{ZmMailList} list
a list that contains this conversation
Method Detail
addMsg(msg, index)
Adds the message at the given index.
Parameters:
{ZmMailMsg} msg
the message to add
{int} index
where to add it

<static> {ZmConv} ZmConv.createFromDom(node, args)
Creates a conv from its JSON representation.
Parameters:
{Object} node
the node
{Hash} args
a hash of arguments
Returns:
{ZmConv} the conversation

<static> {ZmConv} ZmConv.createFromMsg(msg, args)
Creates a conv from msg data.
Parameters:
{ZmMailMsg} msg
the message
{Hash} args
a hash of arguments
Returns:
{ZmConv} the conversation

{AjxVector} getAddresses(type)
Gets a vector of addresses of the given type.
Parameters:
{constant} type
an email address type
Returns:
{AjxVector} a vector of email addresses

{ZmMailMsg} getFirstHotMsg(params, callback)
Gets the first relevant msg of this conv, loading the conv msg list if necessary. If the msg itself hasn't been loaded we also load the conv. The conv load is a SearchConvRequest which fetches the content of the first msg and returns it via a callback. If no callback is provided, the conv will not be loaded - if it already has a msg list, the msg will come from there; otherwise, a skeletal msg with an ID is returned. Note that a conv always has at least one msg.
Parameters:
{Hash} params
a hash of parameters
{String} params.query
the query used to retrieve this conv
{constant} params.sortBy
the sort constraint
{int} params.offset
the position of first msg to return
{int} params.limit
the number of msgs to return
{AjxCallback} callback
the callback to run with results
Returns:
{ZmMailMsg} the message

{String} getMuteIcon()
Gets the mute/unmute icon.
Returns:
{String} the icon

getNumUnreadMsgs()
Returns the number of unread messages in this conversation.

{String} getStatusTooltip()
Gets the status tool tip.
Returns:
{String} the tool tip

{Boolean} hasFlag(flag, value)
Checks if any of the msgs within this conversation has the given value for the given flag. If the conv hasn't been loaded, looks at the conv-level flag.
Parameters:
{constant} flag
the flag (see ZmItem.FLAG_ constants)
{Boolean} value
the test value
Returns:
{Boolean} true if the flag exists

{Boolean} hasMatchingMsg(search, defaultValue)
Checks if this conversation has a message that matches the given search. If we're not able to tell whether a msg matches, we return the given default value.
Parameters:
{ZmSearch} search
the search to match against
{Object} defaultValue
the value to return if search is not matchable or conv not loaded
Returns:
{Boolean} true if this conversation has a matching message

{Boolean} isReadOnly()
Checks if the conversation is read only. Returns false if it cannot be determined.
Returns:
{Boolean} true if the conversation is read only

load(params, callback)
Ensures that the requested range of msgs is loaded, getting them from the server if needed. Because the list of msgs returned by the server contains info about which msgs matched the search, we need to be careful about caching those msgs within the conv. This load function should be used when in a search context, for example when expanding a conv that is the result of a search.
Parameters:
{Hash} params
a hash of parameters:
{String} params.query
the query used to retrieve this conv
{constant} params.sortBy
the sort constraint
{int} params.offset
the position of first msg to return
{int} params.limit
the number of msgs to return
{Boolean} params.getHtml
if true, return HTML part for inlined msg
{String} params.fetch
which msg bodies to fetch (see soap.txt under SearchConvRequest)
{Boolean} params.markRead
if true, mark that msg read
{boolean} params.needExp
if not false, have server check if addresses are DLs
{AjxCallback} callback
the callback to run with results

loadMsgs(params, callback, batchCmd)
This method supports ZmZimletBase::getMsgsForConv. It loads *all* of this conv's messages, including their content. Note that it is not search-based, and uses GetConvRequest rather than SearchConvRequest.
Parameters:
{Hash} params
a hash of parameters
{Boolean} params.fetchAll
if true, fetch content of all msgs
{AjxCallback} callback
the callback
{ZmBatchCommand} batchCmd
the batch cmd that contains this request

removeMsg(msg)
Removes the message.
Parameters:
{ZmMailMsg} msg
the message to remove

Documentation generated by JsDoc Toolkit 2.3.0 on Tue Jun 28 2016 21:01:35 GMT-0400 (EDT)