lib / com.kirkbushman.araw.models / Message

Message

@JsonClass(true) data class Message : Thing, Votable, Created, Distinguishable, Replyable, Parcelable

This class represents the message a user can send or receive. Messages are grouped in the user inbox.

Constructors

<init>

This class represents the message a user can send or receive. Messages are grouped in the user inbox.

Message(id: String, fullname: String, author: String?, body: String, bodyHtml: String, context: String, created: Long, createdUtc: Long, dest: String, distinguishedRaw: String?, firstMessage: Long?, firstMessageName: String?, isComment: Boolean, isUnread: Boolean, likes: Boolean?, numComments: Int?, parentId: String?, score: Int, subject: String, subreddit: String?, subredditNamePrefixed: String?, type: String)

Properties

author

Name of the message's author

val author: String?

body

The raw text. this is the unformatted text which includes the raw markup characters such as ** for bold. <, >, and & are escaped.

val body: String

bodyHtml

The formatted HTML text as displayed on reddit. For example, text that is emphasised by * will now have tags wrapping it. Additionally, bullets and numbered lists will now be in HTML list format. NOTE: The HTML string will be escaped. You must unescape to get the raw HTML.

val bodyHtml: String

context

the message is a comment, then the permalink to the comment with ?context=3 appended to the end, otherwise an empty string

val context: String

created

The unix-time Long representing the creation date of the message.

val created: Long

createdUtc

The unix-time Long representing the UTC creation date of the message.

val createdUtc: Long

dest

The destination of this message.

val dest: String

distinguishedRaw

to allow determining whether they have been distinguished by moderators/admins. null = not distinguished. moderator = the green. admin = the red. special = various other special distinguishes. NOTE: use the extensions in Distinguishable to have an enum representation.

val distinguishedRaw: String?

firstMessage

either null or the first message's ID represented as base 10 (wtf).

val firstMessage: Long?

firstMessageName

either null or the first message's fullname.

val firstMessageName: String?

fullname

Fullname of message, e.g. "t1_c3v7f8u"

val fullname: String

id

This message identifier, e.g. "8xwlg"

val id: String

isComment

if the message relates to a comment under your submission or a reply to the current logged in comment.

val isComment: Boolean

isUnread

if the message is still unread.

val isUnread: Boolean

likes

how the logged-in user has voted on the item, True = upvoted, False = downvoted, null = no vote NOTE: use the extensions to have a practical enum class.

val likes: Boolean?

numComments

number of the comments in the submission, which is the context of this message.

val numComments: Int?

parentId

null if no parent is attached.

val parentId: String?

score

the net-score of the item.

val score: Int

subject

subject of the message.

val subject: String

subreddit

null if not a comment.

val subreddit: String?

subredditNamePrefixed

subreddit name with the /r/ prefix, null if not a comment.

val subredditNamePrefixed: String?

type

can be "comment_type", "post_type", "unknown"

val type: String

Extension Properties

createdDate

Useful extension to convert the creation date property, from the Long unixtime, to a more practical Date object.

val Created.createdDate: Date

createdUtcDate

Useful extension to convert the utc creation date property, from the Long unixtime, to a more practical Date object.

val Created.createdUtcDate: Date

distinguished

Useful extension to map to an enum.

val Distinguishable.distinguished: Distinguished

vote

Useful extension to map to an enum.

val Votable.vote: Vote