Class MessageKt
-
- All Implemented Interfaces:
public final class MessageKt
-
-
Method Summary
Modifier and Type Method Description final DategetNEVER()Internal indicator of a 'never' date. final static List<User>users(Message $self)Retrieves all Users involved in the message. final static List<Message>updateUsers(Collection<Message> $self, Map<String, User> users)Updates collection of messages with more recent data of users. final static Map<String, Message>updateUsers(Map<String, Message> $self, Map<String, User> users)Updates collection of messages with more recent data of users. final static MessageupdateUsers(Message $self, Map<String, User> users)Updates a message with more recent data of users. final static MessagepopulateMentions(Message $self, Channel channel)Fills Message.mentionedUsersIds based on Message.text and Channel.members. final static BooleanwasCreatedAfterOrAt(Message $self, Date date)Checks if the message was created after or at the given date. final static BooleanwasCreatedAfter(Message $self, Date date)Checks if the message was created after the given date. final static BooleanwasCreatedBefore(Message $self, Date date)Checks if the message was created before the given date. final static BooleanwasCreatedBeforeOrAt(Message $self, Date date)Checks if the message was created before or at the given date. final static BooleanshouldIncrementUnreadCount(Message $self, String currentUserId, Date lastMessageAtDate, Boolean isChannelMuted)Function that parses if the unread count should be increased or not. final static BooleanhasPendingAttachments(Message $self)Checks if the given Message has pending attachments. -
-
Method Detail
-
users
final static List<User> users(Message $self)
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.
-
updateUsers
final static List<Message> updateUsers(Collection<Message> $self, Map<String, User> users)
Updates collection of messages with more recent data of users.
-
updateUsers
final static Map<String, Message> updateUsers(Map<String, Message> $self, Map<String, User> users)
Updates collection of messages with more recent data of users.
-
updateUsers
final static Message updateUsers(Message $self, Map<String, User> users)
Updates a message with more recent data of users. It updates author user, latestReactions, replyTo message, mentionedUsers, threadParticipants and pinnedBy user of this instance.
-
populateMentions
final static Message populateMentions(Message $self, Channel channel)
Fills Message.mentionedUsersIds based on Message.text and Channel.members.
It combines the users found in the input with pre-set Message.mentionedUsersIds, in case someone is manually added as a mention. Currently only searches through the channel members for possible mentions.
- Parameters:
channel- The channel whose members we can check for the mention.
-
wasCreatedAfterOrAt
final static Boolean wasCreatedAfterOrAt(Message $self, Date date)
Checks if the message was created after or at the given date.
-
wasCreatedAfter
final static Boolean wasCreatedAfter(Message $self, Date date)
Checks if the message was created after the given date.
-
wasCreatedBefore
final static Boolean wasCreatedBefore(Message $self, Date date)
Checks if the message was created before the given date.
-
wasCreatedBeforeOrAt
final static Boolean wasCreatedBeforeOrAt(Message $self, Date date)
Checks if the message was created before or at the given date.
-
shouldIncrementUnreadCount
final static Boolean shouldIncrementUnreadCount(Message $self, String currentUserId, Date lastMessageAtDate, Boolean isChannelMuted)
Function that parses if the unread count should be increased or not.
- Parameters:
currentUserId- The id of the user that the unread count should be evaluated.lastMessageAtDate- The Date of the last message the SDK is aware of.isChannelMuted- If the channel is muted for the current user or not.
-
hasPendingAttachments
final static Boolean hasPendingAttachments(Message $self)
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.
-
-
-
-