Class ChannelKt

  • All Implemented Interfaces:

    
    public final class ChannelKt
    
                        
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final static Message getPreviewMessage(Channel $self, User currentUser) Returns channel's last regular or system message if exists.
      final static String getDisplayName(Channel $self, Context context, User currentUser, @StringRes() Integer fallback, Integer maxMembers) Returns the channel name if exists, or the list of member names if the channel is distinct.
      final static String getMembersStatusText(Channel $self, Context context, User currentUser, @StringRes() Integer userOnlineResId, @StringRes() Integer userLastSeenJustNowResId, @StringRes() Integer userLastSeenResId, @PluralsRes() Integer memberCountResId, @StringRes() Integer memberCountWithOnlineResId) Returns a string describing the member status of the channel: either a member count for a group channel or the last seen text for a direct one-to-one conversation with the current user.
      • Methods inherited from class java.lang.Object

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

    • Method Detail

      • getPreviewMessage

         final static Message getPreviewMessage(Channel $self, User currentUser)

        Returns channel's last regular or system message if exists. Deleted and silent messages, as well as messages from shadow-banned users, are not taken into account.

        Returns:

        Last message from the channel or null if it doesn't exist.

      • getDisplayName

         final static String getDisplayName(Channel $self, Context context, User currentUser, @StringRes() Integer fallback, Integer maxMembers)

        Returns the channel name if exists, or the list of member names if the channel is distinct.

        Parameters:
        context - The context to load string resources.
        currentUser - The currently logged-in user.
        fallback - The resource identifier of a fallback string if the Channel object lacks information to construct a valid display name string.
        maxMembers - The maximum number of members used to generate a name for a distinct channel.
        Returns:

        The display name of the channel.

      • getMembersStatusText

         final static String getMembersStatusText(Channel $self, Context context, User currentUser, @StringRes() Integer userOnlineResId, @StringRes() Integer userLastSeenJustNowResId, @StringRes() Integer userLastSeenResId, @PluralsRes() Integer memberCountResId, @StringRes() Integer memberCountWithOnlineResId)

        Returns a string describing the member status of the channel: either a member count for a group channel or the last seen text for a direct one-to-one conversation with the current user.

        Parameters:
        context - The context to load string resources.
        currentUser - The currently logged in user.
        Returns:

        The text that represent the member status of the channel.