Class Message
-
- All Implemented Interfaces:
-
io.getstream.chat.android.models.CustomObject,io.getstream.chat.android.models.querysort.ComparableFieldProvider
public final class Message implements CustomObject, ComparableFieldProvider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classMessage.Builder
-
Field Summary
-
Constructor Summary
Constructors Constructor Description Message(String id, String cid, String text, String html, String parentId, String command, List<Attachment> attachments, List<String> mentionedUsersIds, List<User> mentionedUsers, Integer replyCount, Map<String, Integer> reactionCounts, Map<String, Integer> reactionScores, SyncStatus syncStatus, MessageSyncDescription syncDescription, String type, List<Reaction> latestReactions, List<Reaction> ownReactions, Date createdAt, Date updatedAt, Date deletedAt, Date updatedLocallyAt, Date createdLocallyAt, User user, Map<String, Object> extraData, Boolean silent, Boolean shadowed, Map<String, String> i18n, Boolean showInChannel, ChannelInfo channelInfo, Message replyTo, String replyMessageId, Boolean pinned, Date pinnedAt, Date pinExpires, User pinnedBy, List<User> threadParticipants, Boolean skipPushNotification, Boolean skipEnrichUrl)
-
Method Summary
Modifier and Type Method Description final StringgetOriginalLanguage()final StringgetId()The unique string identifier of the message. final StringgetCid()Channel unique identifier in <type>:<id> format final StringgetText()The text of this message final StringgetHtml()The message text formatted as HTML final StringgetParentId()The ID of the parent message, if the message is a thread reply final StringgetCommand()Contains provided slash command final List<Attachment>getAttachments()The list of message attachments final List<String>getMentionedUsersIds()The list of user mentioned in the message final List<User>getMentionedUsers()The list of user mentioned in the message final IntegergetReplyCount()The number of replies to this message final Map<String, Integer>getReactionCounts()A mapping between reaction type and the count, ie like:10, heart:4 final Map<String, Integer>getReactionScores()A mapping between reaction type and the reaction score, ie like:10, heart:4 final SyncStatusgetSyncStatus()If the message has been synced to the servers, default is synced final MessageSyncDescriptiongetSyncDescription()Contains details related to syncStatus. final StringgetType()Contains type of the message. final List<Reaction>getLatestReactions()List of the latest reactions to this message final List<Reaction>getOwnReactions()List of reactions of authenticated user to this message final DategetCreatedAt()When the message was created final DategetUpdatedAt()When the message was updated final DategetDeletedAt()When the message was deleted final DategetUpdatedLocallyAt()When the message was updated locally final DategetCreatedLocallyAt()When the message was created locally final UnitsetCreatedLocallyAt(Date createdLocallyAt)When the message was created locally final UsergetUser()The user who sent the message Map<String, Object>getExtraData()All the custom data provided for this message final BooleangetSilent()Whether message is silent or not final BooleangetShadowed()If the message was sent by shadow banned user final Map<String, String>getI18n()Mapping with translations. final BooleangetShowInChannel()Whether thread reply should be shown in the channel as well final ChannelInfogetChannelInfo()final MessagegetReplyTo()Contains quoted message final StringgetReplyMessageId()The ID of the quoted message, if the message is a quoted reply. final BooleangetPinned()Whether message is pinned or not final DategetPinnedAt()Date when the message got pinned final DategetPinExpires()Date when pinned message expires final UsergetPinnedBy()Contains user who pinned the message final List<User>getThreadParticipants()The list of users who participate in thread final BooleangetSkipPushNotification()If the message should skip triggering a push notification when sent. final BooleangetSkipEnrichUrl()If the message should skip enriching the URL. Comparable<?>getComparableField(String fieldName)Gets a comparable fields from a name. final StringgetTranslation(String language)final LongidentifierHash()Identifier of message. StringtoString()final Message.BuildernewBuilder()-
-
Constructor Detail
-
Message
Message(String id, String cid, String text, String html, String parentId, String command, List<Attachment> attachments, List<String> mentionedUsersIds, List<User> mentionedUsers, Integer replyCount, Map<String, Integer> reactionCounts, Map<String, Integer> reactionScores, SyncStatus syncStatus, MessageSyncDescription syncDescription, String type, List<Reaction> latestReactions, List<Reaction> ownReactions, Date createdAt, Date updatedAt, Date deletedAt, Date updatedLocallyAt, Date createdLocallyAt, User user, Map<String, Object> extraData, Boolean silent, Boolean shadowed, Map<String, String> i18n, Boolean showInChannel, ChannelInfo channelInfo, Message replyTo, String replyMessageId, Boolean pinned, Date pinnedAt, Date pinExpires, User pinnedBy, List<User> threadParticipants, Boolean skipPushNotification, Boolean skipEnrichUrl)
-
-
Method Detail
-
getOriginalLanguage
final String getOriginalLanguage()
-
getId
final String getId()
The unique string identifier of the message. This is either created by Stream or set on the client side when the message is added.
-
getParentId
final String getParentId()
The ID of the parent message, if the message is a thread reply
-
getCommand
final String getCommand()
Contains provided slash command
-
getAttachments
final List<Attachment> getAttachments()
The list of message attachments
-
getMentionedUsersIds
final List<String> getMentionedUsersIds()
The list of user mentioned in the message
-
getMentionedUsers
final List<User> getMentionedUsers()
The list of user mentioned in the message
-
getReplyCount
final Integer getReplyCount()
The number of replies to this message
-
getReactionCounts
final Map<String, Integer> getReactionCounts()
A mapping between reaction type and the count, ie like:10, heart:4
-
getReactionScores
final Map<String, Integer> getReactionScores()
A mapping between reaction type and the reaction score, ie like:10, heart:4
-
getSyncStatus
final SyncStatus getSyncStatus()
If the message has been synced to the servers, default is synced
-
getSyncDescription
final MessageSyncDescription getSyncDescription()
Contains details related to syncStatus.
-
getType
final String getType()
Contains type of the message. Can be one of the following: regular, ephemeral, error, reply, system, deleted.
-
getLatestReactions
final List<Reaction> getLatestReactions()
List of the latest reactions to this message
-
getOwnReactions
final List<Reaction> getOwnReactions()
List of reactions of authenticated user to this message
-
getCreatedAt
final Date getCreatedAt()
When the message was created
-
getUpdatedAt
final Date getUpdatedAt()
When the message was updated
-
getDeletedAt
final Date getDeletedAt()
When the message was deleted
-
getUpdatedLocallyAt
final Date getUpdatedLocallyAt()
When the message was updated locally
-
getCreatedLocallyAt
final Date getCreatedLocallyAt()
When the message was created locally
-
setCreatedLocallyAt
final Unit setCreatedLocallyAt(Date createdLocallyAt)
When the message was created locally
-
getExtraData
Map<String, Object> getExtraData()
All the custom data provided for this message
-
getShadowed
final Boolean getShadowed()
If the message was sent by shadow banned user
-
getI18n
final Map<String, String> getI18n()
Mapping with translations. Key
languagecontains the original language key. Other keys contain translations.
-
getShowInChannel
final Boolean getShowInChannel()
Whether thread reply should be shown in the channel as well
-
getChannelInfo
final ChannelInfo getChannelInfo()
-
getReplyTo
final Message getReplyTo()
Contains quoted message
-
getReplyMessageId
final String getReplyMessageId()
The ID of the quoted message, if the message is a quoted reply.
-
getPinnedAt
final Date getPinnedAt()
Date when the message got pinned
-
getPinExpires
final Date getPinExpires()
Date when pinned message expires
-
getPinnedBy
final User getPinnedBy()
Contains user who pinned the message
-
getThreadParticipants
final List<User> getThreadParticipants()
The list of users who participate in thread
-
getSkipPushNotification
final Boolean getSkipPushNotification()
If the message should skip triggering a push notification when sent. Used when sending a new message. False by default.
Note: This property is local only, it is not sent to the backend.
-
getSkipEnrichUrl
final Boolean getSkipEnrichUrl()
If the message should skip enriching the URL. If URl is not enriched, it will not be displayed as a link attachment. Used when sending or updating a message. False by default.
Note: This property is local only, it is not sent to the backend.
-
getComparableField
Comparable<?> getComparableField(String fieldName)
Gets a comparable fields from a name.
- Parameters:
fieldName- The name of the field.
-
getTranslation
final String getTranslation(String language)
-
identifierHash
final Long identifierHash()
Identifier of message. The message can't be considered the same if the id of the message AND the id of a quoted message are not the same.
-
newBuilder
@SinceKotlin(version = "99999.9") final Message.Builder newBuilder()
-
-
-
-