-
public final class MessageUtils
-
-
Method Summary
Modifier and Type Method Description final static MessagelatestOrNull(List<Message> $self)Peeks the latest message from the sorted List of messages. final static BooleancreatedAfter(Message $self, Message that)Tests if this message was created after that message. final static BooleanisFailed(Message $self)final static BooleanisErrorOrFailed(Message $self)final static BooleanisDeleted(Message $self)final static BooleanisPinned(Message $self, Function0<Long> now)final static BooleanisPinExpired(Message $self, Function0<Long> now)final static BooleanisRegular(Message $self)final static BooleanisEphemeral(Message $self)final static BooleanisSystem(Message $self)final static BooleanisError(Message $self)final static BooleanisGiphy(Message $self)final static BooleanhasAudioRecording(Message $self)final static BooleanisPoll(Message $self)final static BooleanisPollClosed(Message $self)final static BooleanisGiphyEphemeral(Message $self)final static BooleanisThreadStart(Message $self)final static BooleanisThreadReply(Message $self)final static BooleanbelongsToThread(Message $self)final static BooleanisReply(Message $self)final static BooleanhasSharedLocation(Message $self)final static BooleanisMine(Message $self, String currentUserId)final static BooleanisModerationBounce(Message $self)final static BooleanisModerationBlock(Message $self)final static BooleanisModerationFlag(Message $self)final static BooleanisModerationError(Message $self, String currentUserId)final static Result<Unit>shouldDeleteRemote(Message $self, String currentUserId)Checks whether we should attempt to delete the message remotely. final static BooleanisLocalOnly(Message $self)-
-
Method Detail
-
latestOrNull
final static Message latestOrNull(List<Message> $self)
Peeks the latest message from the sorted List of messages.
-
createdAfter
final static Boolean createdAfter(Message $self, Message that)
Tests if this message was created after that message.
-
isErrorOrFailed
final static Boolean isErrorOrFailed(Message $self)
-
isPinned
final static Boolean isPinned(Message $self, Function0<Long> now)
- Parameters:
now- A function that provides the current time in milliseconds.
-
isPinExpired
final static Boolean isPinExpired(Message $self, Function0<Long> now)
-
isEphemeral
final static Boolean isEphemeral(Message $self)
-
hasAudioRecording
final static Boolean hasAudioRecording(Message $self)
-
isPollClosed
final static Boolean isPollClosed(Message $self)
-
isGiphyEphemeral
final static Boolean isGiphyEphemeral(Message $self)
-
isThreadStart
final static Boolean isThreadStart(Message $self)
-
isThreadReply
final static Boolean isThreadReply(Message $self)
-
belongsToThread
final static Boolean belongsToThread(Message $self)
-
hasSharedLocation
final static Boolean hasSharedLocation(Message $self)
-
isModerationBounce
final static Boolean isModerationBounce(Message $self)
-
isModerationBlock
final static Boolean isModerationBlock(Message $self)
-
isModerationFlag
final static Boolean isModerationFlag(Message $self)
-
isModerationError
final static Boolean isModerationError(Message $self, String currentUserId)
-
shouldDeleteRemote
final static Result<Unit> shouldDeleteRemote(Message $self, String currentUserId)
Checks whether we should attempt to delete the message remotely.
- Parameters:
currentUserId- The ID of the currently logged in user.
-
isLocalOnly
final static Boolean isLocalOnly(Message $self)
-
-
-
-