public class MailThreadInfo
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
class |
MailThreadInfo.Sender
The class describes a single participant in this email thread.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ELEMENT_NAME
The name of the "mail-thread-info" element.
|
static java.lang.String |
LABELS_ELEMENT_NAME
The name of the XML tag element containing a pipe separated list of
labels assigned to this thread.
|
static int |
PARTICIPATION_NONE
Indicates that the local user has not participated in this thread.
|
static int |
PARTICIPATION_ONE_OF_MANY
Indicates that the user is one of many recipients listed in the thread.
|
static int |
PARTICIPATION_SOLE_RECIPIENT
PARTICIPATION_SOLE_RECIPIENT indicates that the user is the sole
recipient for messages in this thread.
|
static java.lang.String |
SENDERS_ELEMENT_NAME
The name of the XML tag element containing the list of all senders.
|
static java.lang.String |
SNIPPET_ELEMENT_NAME
The name of the XML tag element containing a snippet of the thread.
|
static java.lang.String |
SUBJECT_ELEMENT_NAME
The name of the XML tag element containing the thread subject.
|
Constructor and Description |
---|
MailThreadInfo() |
Modifier and Type | Method and Description |
---|---|
protected void |
addSender(MailThreadInfo.Sender sender)
Adds sender to the list of senders in this thread.
|
java.lang.String |
createHtmlDescription()
Creates an html description (table rows) of the specified thread.
|
java.lang.String |
findOriginator(boolean firstNameOnly)
Returns the sender that initiated the thread or the first sender in the
list if for some reason we couldn't determine the originator.
|
long |
getDate()
Returns the date of the most recent message in this thread.
|
java.lang.String |
getLabels()
Returns a pipe ('|') delimited list of labels applied to this thread.
|
int |
getMessageCount()
Returns the number of messages in this thread.
|
int |
getParticipation()
Returns the participation index for this thread.
|
int |
getSenderCount()
Returns the number of people that have been posting in this thread.
|
java.lang.String |
getSnippet()
Returns an html-encoded snippet from the body of the email.
|
java.lang.String |
getSubject()
Returns the subject of this e-mail thread.
|
java.lang.String |
getTid()
Returns the ID of this thread.
|
int |
getUnreadSenderCount()
Returns the number of people that have been posting in this thread and
that we have unread messages from.
|
java.lang.String |
getURL()
Returns an URL linking to this thread.
|
static MailThreadInfo |
parse(org.xmlpull.v1.XmlPullParser parser)
Creates and initializes a MailThreadInfo instance according to
the details that come with the parser.
|
java.util.Iterator<MailThreadInfo.Sender> |
senders()
Returns an iterator over a list of one or more sender instances, each of
which describes a participant in this thread.
|
protected void |
setDate(long date)
Sets the date of the most recent message in this thread.
|
protected void |
setLabels(java.lang.String labels)
Sets a pipe ('|') delimited list of labels that apply to this thread.
|
protected void |
setMessageCount(int messageCount)
Sets the number of messages in this thread.
|
protected void |
setParticipation(int participation)
Specifies the participation index for this thread.
|
protected void |
setSnippet(java.lang.String snippet)
Sets an html-encoded snippet from the body of the email.
|
protected void |
setSubject(java.lang.String subject)
Sets the subject of this e-mail thread.
|
protected void |
setTid(java.lang.String tid)
Specifies the ID of this thread.
|
protected void |
setURL(java.lang.String url)
Sets an URL linking to this thread.
|
public static final java.lang.String ELEMENT_NAME
public static final java.lang.String SENDERS_ELEMENT_NAME
public static final java.lang.String LABELS_ELEMENT_NAME
public static final java.lang.String SUBJECT_ELEMENT_NAME
public static final java.lang.String SNIPPET_ELEMENT_NAME
public static final int PARTICIPATION_NONE
public static final int PARTICIPATION_ONE_OF_MANY
public static final int PARTICIPATION_SOLE_RECIPIENT
public int getParticipation()
protected void setParticipation(int participation)
participation
- one of the PARTICIPATION_XXX values defines in this
class and indicating whether the local is the sole, one of many or not a
participant of this thread.public java.util.Iterator<MailThreadInfo.Sender> senders()
public int getSenderCount()
public int getUnreadSenderCount()
public java.lang.String findOriginator(boolean firstNameOnly)
firstNameOnly
- use only first nameprotected void addSender(MailThreadInfo.Sender sender)
sender
- the sender that we are adding.public int getMessageCount()
protected void setMessageCount(int messageCount)
messageCount
- the number of messages in this thread.public long getDate()
protected void setDate(long date)
date
- a timestamp of the most recent message in this thread.public java.lang.String getURL()
protected void setURL(java.lang.String url)
url
- the URL linking to this particular thread.public java.lang.String getLabels()
protected void setLabels(java.lang.String labels)
labels
- a pipe ('|') delimited list of labels that apply to this
thread.public java.lang.String getTid()
protected void setTid(java.lang.String tid)
tid
- the ID of this thread.public java.lang.String getSubject()
protected void setSubject(java.lang.String subject)
subject
- the subject of this e-mail thread.public java.lang.String getSnippet()
protected void setSnippet(java.lang.String snippet)
snippet
- an html-encoded snippet from the body of the email.public static MailThreadInfo parse(org.xmlpull.v1.XmlPullParser parser) throws org.xmlpull.v1.XmlPullParserException, java.lang.NumberFormatException, java.io.IOException
parser
- the parse that we are to read the MailThreadInfo
from.org.xmlpull.v1.XmlPullParserException
- if something goes wrong while parsing
the document.java.lang.NumberFormatException
- in case we fail to parse any of the
elements that we expect to be numerical.java.io.IOException
- in case reading the input xml fails.public java.lang.String createHtmlDescription()
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.