public class ChatHtmlUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DATE_ATTRIBUTE
The date attribute.
|
static java.lang.String |
HTML_CONTENT_TYPE
The html text content type.
|
static java.lang.String |
MESSAGE_HEADER_ID
The message header identifier attribute.
|
static java.lang.String |
MESSAGE_TEXT_ID
The message identifier attribute.
|
static java.lang.String |
MSG_IN_NAME_FOREGROUND
The color used in html for incoming message contact name foreground.
|
static java.lang.String |
MSG_NAME_BACKGROUND
The color used in html for name background.
|
static java.lang.String |
NAME_ATTRIBUTE
The name attribute.
|
static java.lang.String |
ORIGINAL_MESSAGE_ATTRIBUTE
The name of the attribute containing the original chat message before
processing replacements.
|
static java.lang.String |
TEXT_CONTENT_TYPE
The plain text content type.
|
Constructor and Description |
---|
ChatHtmlUtils() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
createEditedAtTag(java.lang.String messageUID,
long date)
Creates a tag that shows the last edit time of a message, in the format
(Edited at ...).
|
static java.lang.String |
createIncomingMessageTag(java.lang.String messageID,
java.lang.String contactName,
java.lang.String contactDisplayName,
java.lang.String avatarPath,
java.util.Date date,
java.lang.String message,
java.lang.String contentType,
boolean isHistory,
boolean isSimpleTheme)
Creates an incoming message tag.
|
static java.lang.String |
createMessageTag(java.lang.String messageID,
java.lang.String contactName,
java.lang.String message,
java.lang.String contentType,
java.util.Date date,
boolean isEdited,
boolean isHistory,
boolean isSimpleTheme)
Creates the message tag.
|
static java.lang.String |
createOutgoingMessageTag(java.lang.String messageID,
java.lang.String contactName,
java.lang.String contactDisplayName,
java.lang.String avatarPath,
java.util.Date date,
java.lang.String message,
java.lang.String contentType,
boolean isHistory,
boolean isSimpleTheme)
Create an outgoing message tag.
|
static java.lang.String |
getDateString(java.util.Date date)
Returns the date string to show for the given date.
|
public static final java.lang.String NAME_ATTRIBUTE
public static final java.lang.String DATE_ATTRIBUTE
public static final java.lang.String ORIGINAL_MESSAGE_ATTRIBUTE
public static final java.lang.String MESSAGE_HEADER_ID
public static final java.lang.String MESSAGE_TEXT_ID
public static final java.lang.String HTML_CONTENT_TYPE
public static final java.lang.String TEXT_CONTENT_TYPE
public static final java.lang.String MSG_NAME_BACKGROUND
public static final java.lang.String MSG_IN_NAME_FOREGROUND
public static java.lang.String createIncomingMessageTag(java.lang.String messageID, java.lang.String contactName, java.lang.String contactDisplayName, java.lang.String avatarPath, java.util.Date date, java.lang.String message, java.lang.String contentType, boolean isHistory, boolean isSimpleTheme)
messageID
- the identifiercontactName
- the name of the contact sending the messagecontactDisplayName
- the display name of the contact sending the
messageavatarPath
- the path to the avatar filedate
- the date, when the message was sentmessage
- the message contentcontentType
- the content type HTML or PLAIN_TEXTisHistory
- indicates if this is a message coming from historyisSimpleTheme
- indicates if the simple or the advance theme should
be usedpublic static java.lang.String createOutgoingMessageTag(java.lang.String messageID, java.lang.String contactName, java.lang.String contactDisplayName, java.lang.String avatarPath, java.util.Date date, java.lang.String message, java.lang.String contentType, boolean isHistory, boolean isSimpleTheme)
messageID
- the identifier of the messagecontactName
- the name of the account sending the messagecontactDisplayName
- the display name of the account sending the
messageavatarPath
- the path to the avatar imagedate
- the date, when the message was sentmessage
- the content of the messagecontentType
- the content type HTML or PLAIN_TEXTisHistory
- indicates if this is a message coming from historyisSimpleTheme
- indicates if the simple or the advance theme should
be usedpublic static java.lang.String createMessageTag(java.lang.String messageID, java.lang.String contactName, java.lang.String message, java.lang.String contentType, java.util.Date date, boolean isEdited, boolean isHistory, boolean isSimpleTheme)
messageID
- the identifier of the messagecontactName
- the name of the sendermessage
- the message contentcontentType
- the content type (html or plain text)date
- the date on which the message was sentisEdited
- indicates if the given message has been editedisHistory
- indicates if this is a message coming from historyisSimpleTheme
- indicates if the simple or the advance theme should
be usedpublic static java.lang.String createEditedAtTag(java.lang.String messageUID, long date)
messageUID
- The ID of the edited message.date
- The date when the message was last edited, or -1 to generate
an empty tag.public static java.lang.String getDateString(java.util.Date date)
date
- the date to format
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.