Package-level declarations

Properties

Link copied to clipboard
val NEVER: Date

Internal indicator of a 'never' date.

Inherited properties

Link copied to clipboard

Retrieves the last not deleted Message of the Channel, calculated as the messages with the most recent Message.createdAt or Message.createdLocallyAt.

Functions

Link copied to clipboard
fun mergeReactions(recentReactions: Collection<Reaction>, cachedReactions: Collection<Reaction>): Collection<Reaction>

Merges two collections of reactions by their Reaction.type.

Inherited functions

Link copied to clipboard

Adds member to the Channel.members and aligns Channel.memberCount.

Link copied to clipboard
fun Channel.addMembership(currentUserId: String, member: Member): Channel

Sets Channel.membership to member if currentUserId equals to member.getUserId().

Link copied to clipboard
fun Message.addMyReaction(reaction: Reaction, enforceUnique: Boolean = false): Message

Add a Reaction created by the currently logged user to the given Message.

Link copied to clipboard
Link copied to clipboard

Enriches the wrapped Message from the ChatEvent with the Channel ID.

Link copied to clipboard
fun Reaction.enrichWithDataBeforeSending(currentUser: User, isOnline: Boolean, enforceUnique: Boolean): Reaction
Link copied to clipboard

Checks if the given Message has pending attachments. A pending attachment is an attachment that is either in Attachment.UploadState.InProgress or Attachment.UploadState.Idle.

Link copied to clipboard
fun Thread.markAsReadByUser(threadInfo: ThreadInfo, user: User, createdAt: Date): Thread

Marks the given thread as read by the given user.

Link copied to clipboard
fun Thread.markAsUnreadByUser(user: User, createdAt: Date): Thread

Marks the given thread as unread by the given user.

Link copied to clipboard
fun AnswerCastedEvent.processPoll(getOldPoll: (String) -> Poll?): Poll

Processes the AnswerCastedEvent and updates the poll with the new answer.

fun PollClosedEvent.processPoll(getOldPoll: (String) -> Poll?): Poll

Processes the PollClosedEvent and updates the poll by marking it as closed.

fun PollUpdatedEvent.processPoll(getOldPoll: (String) -> Poll?): Poll

Processes the PollUpdatedEvent and updates the poll with the new data.

fun VoteRemovedEvent.processPoll(getOldPoll: (String) -> Poll?): Poll

Processes the VoteRemovedEvent and updates the poll by removing the vote.

fun VoteCastedEvent.processPoll(currentUserId: String?, getOldPoll: (String) -> Poll?): Poll

Processes the VoteCastedEvent and updates the poll with the new vote.

fun VoteChangedEvent.processPoll(currentUserId: String?, getOldPoll: (String) -> Poll?): Poll

Processes the VoteChangedEvent and updates the poll with the new vote.

Link copied to clipboard
fun Channel.removeMember(memberUserId: String?): Channel

Removes member from the Channel.members and aligns Channel.memberCount.

Link copied to clipboard
fun Channel.removeMembership(currentUserId: String?): Channel

Sets Channel.membership to null if currentUserId equals to membership.user.id.

Link copied to clipboard

Remove a Reaction created by the currently logged user from the given Message.

Link copied to clipboard
fun Message.shouldIncrementUnreadCount(currentUserId: String, lastMessageAtDate: Date?, isChannelMuted: Boolean): Boolean

Function that parses if the unread count should be increased or not.

Link copied to clipboard

Converts a pair of channelType and channelId into cid.

Link copied to clipboard

Updates collection of reactions with more recent data of users.

Link copied to clipboard
fun Channel.updateLastMessage(receivedEventDate: Date, message: Message, currentUserId: String): Channel

Updates the Channel with newest Message.

Link copied to clipboard

Updates Channel member.

Link copied to clipboard
fun Channel.updateMemberBanned(memberUserId: String, banned: Boolean, shadow: Boolean): Channel

Updates Member.banned property inside the Channel.members.

Link copied to clipboard

Sets Channel.membership to member if member.user.id equals to Channel.membership.user.id.

Link copied to clipboard
fun Channel.updateMembershipBanned(memberUserId: String, banned: Boolean): Channel

Sets Channel.membership.banned to banned if memberUserId equals to Channel.membership.user.id.

Link copied to clipboard

Updates the parent message of a Thread.

Link copied to clipboard

Updates the given Thread with the new message (parent or reply).

Link copied to clipboard
fun Channel.updateReads(newRead: ChannelUserRead, currentUserId: UserId): Channel

Updates the Channel with a new ChannelUserRead. If an existing read for the user already exists, it will be replaced with the new one. If not, the new read will be added to the list of reads.

Link copied to clipboard
fun Reaction.updateSyncStatus(result: Result<*>): Reaction

Updates the reaction's sync status based on result.

Link copied to clipboard

Updates a message with more recent data of users. It updates author user, latestReactions, replyTo message, mentionedUsers, threadParticipants and pinnedBy user of this instance.

Updates collection of channels with more recent data of users.

Updates collection of members with more recent data of users.

Updates collection of messages with more recent data of users.

Updates a collection of users by more fresh value of users.

Link copied to clipboard

Inserts a new reply (or updates and existing one) in a Thread.

Link copied to clipboard

Returns all users including watchers of a channel that are associated with it.

Retrieves all Users involved in the message. Includes the author, reaction authors, original message author (if the message is reply), mentioned users, thread participants, pinned by user, and poll voters.

Link copied to clipboard

Checks if the message was created after the given date.

Link copied to clipboard

Checks if the message was created after or at the given date.

Link copied to clipboard

Checks if the message was created before the given date.

Link copied to clipboard

Checks if the message was created before or at the given date.