Package 

Class ChannelExtensionKt

    • Method Summary

      Modifier and Type Method Description
      final static Boolean isAnonymousChannel(Channel $self) Checks if the channel is an anonymous channel (without name).
      final static Boolean isPinned(Channel $self) Checks if the channel is pinned or not for the current user.
      final static Boolean isArchive(Channel $self) Checks if the channel is archived or not for the current user.
      final static Boolean isMutedFor(Channel $self, User user) Checks if Channel is muted for user.
      final static List<User> getUsersExcludingCurrent(Channel $self, User currentUser) Returns a list of users that are members of the channel excluding the currently logged in user.
      final static List<Member> getMembersExcludingCurrent(Channel $self, User currentUser) Returns a list of members of the channel excluding the currently logged in user.
      final static Integer countUnreadMentionsForUser(Channel $self, User user) Counts messages in which user is mentioned.
      final static Integer )>currentUserUnreadCount(Channel $self, <ERROR CLASS> currentUserId) Returns the number of unread messages in the channel for the current user.
      final static Channel )>syncUnreadCountWithReads(Channel $self, <ERROR CLASS> currentUserId) Synchronizes the unread count of the channel with the read state of the current user.
      final static List<ChannelUserRead> readsOf(Channel $self, Message message) Returns a list of ChannelUserRead objects representing which ones have read the given message.
      final static List<ChannelUserRead> deliveredReadsOf(Channel $self, Message message) Returns a list of ChannelUserRead objects representing which ones have delivered the given message.
      • Methods inherited from class java.lang.Object

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

      • isAnonymousChannel

         final static Boolean isAnonymousChannel(Channel $self)

        Checks if the channel is an anonymous channel (without name).

      • isPinned

         final static Boolean isPinned(Channel $self)

        Checks if the channel is pinned or not for the current user.

      • isArchive

         final static Boolean isArchive(Channel $self)

        Checks if the channel is archived or not for the current user.

      • isMutedFor

         final static Boolean isMutedFor(Channel $self, User user)

        Checks if Channel is muted for user.

      • getUsersExcludingCurrent

         final static List<User> getUsersExcludingCurrent(Channel $self, User currentUser)

        Returns a list of users that are members of the channel excluding the currently logged in user.

        Parameters:
        currentUser - The currently logged in user.
      • getMembersExcludingCurrent

         final static List<Member> getMembersExcludingCurrent(Channel $self, User currentUser)

        Returns a list of members of the channel excluding the currently logged in user.

        Parameters:
        currentUser - The currently logged in user.
      • countUnreadMentionsForUser

         final static Integer countUnreadMentionsForUser(Channel $self, User user)

        Counts messages in which user is mentioned. The method relies on the Channel.messages list and doesn't do any API call. Therefore, the count might be not reliable as it relies on the local data.

        Parameters:
        user - The User object for which unread mentions are counted.
      • currentUserUnreadCount

         final static Integer )>currentUserUnreadCount(Channel $self, <ERROR CLASS> currentUserId)

        Returns the number of unread messages in the channel for the current user.

      • syncUnreadCountWithReads

         final static Channel )>syncUnreadCountWithReads(Channel $self, <ERROR CLASS> currentUserId)

        Synchronizes the unread count of the channel with the read state of the current user.

        Parameters:
        currentUserId - The ID of the current user.
      • readsOf

         final static List<ChannelUserRead> readsOf(Channel $self, Message message)

        Returns a list of ChannelUserRead objects representing which ones have read the given message.

        A message is considered read by a user if:

        • The user is not the sender of the message

        • The user has read the message

        Parameters:
        message - The Message object for which to find read reads.
      • deliveredReadsOf

         final static List<ChannelUserRead> deliveredReadsOf(Channel $self, Message message)

        Returns a list of ChannelUserRead objects representing which ones have delivered the given message.

        A message is considered delivered to a user if:

        • The user is not the sender of the message

        • The user has received (delivered) the message

        Parameters:
        message - The Message object for which to find delivered reads.