Class MessageKt

  • All Implemented Interfaces:

    
    public final class MessageKt
    
                        
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private final static Date NEVER
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final Date getNEVER() 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 Message updateUsers(Message $self, Map<String, User> users) Updates a message with more recent data of users.
      final static Message populateMentions(Message $self, Channel channel) Fills Message.mentionedUsersIds based on Message.text and Channel.members.
      final static Boolean wasCreatedAfterOrAt(Message $self, Date date) Checks if the message was created after or at the given date.
      final static Boolean wasCreatedAfter(Message $self, Date date) Checks if the message was created after the given date.
      final static Boolean wasCreatedBefore(Message $self, Date date) Checks if the message was created before the given date.
      final static Boolean wasCreatedBeforeOrAt(Message $self, Date date) Checks if the message was created before or at the given date.
      final static Boolean shouldIncrementUnreadCount(Message $self, String currentUserId, Date lastMessageAtDate, Boolean isChannelMuted) Function that parses if the unread count should be increased or not.
      final static Boolean hasPendingAttachments(Message $self) Checks if the given Message has pending attachments.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • getNEVER

         final Date getNEVER()

        Internal indicator of a 'never' date.

      • 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 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.