Class MessageKt
-
- All Implemented Interfaces:
public final class MessageKt
-
-
Method Summary
Modifier and Type Method Description final DategetNEVER()final static List<User>users(Message $self)final static List<Message>updateUsers(Collection<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)final static BooleanwasCreatedAfter(Message $self, Date date)final static BooleanwasCreatedBefore(Message $self, Date date)final static BooleanwasCreatedBeforeOrAt(Message $self, Date 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)-
-
Method Detail
-
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 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)
-
wasCreatedAfter
final static Boolean wasCreatedAfter(Message $self, Date date)
-
wasCreatedBefore
final static Boolean wasCreatedBefore(Message $self, Date date)
-
wasCreatedBeforeOrAt
final static Boolean wasCreatedBeforeOrAt(Message $self, Date 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)
-
-
-
-