Package ovh.mythmc.social.api.context
Class SocialRegisteredMessageContext
java.lang.Object
ovh.mythmc.social.api.context.SocialMessageContext
ovh.mythmc.social.api.context.SocialRegisteredMessageContext
- All Implemented Interfaces:
SocialContext
Represents a registered and persisted social message.
SocialRegisteredMessageContext extends SocialMessageContext
and adds metadata that becomes available once a message has been stored
in the chat history system.
In addition to the base message context, this class provides:
- A unique message identifier
- The fully processed
Componentmessage - The message creation timestamp
Instances of this class typically represent messages that have been registered in the chat history and can therefore be referenced (e.g. replies).
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSocialRegisteredMessageContext(int id, long timestamp, SocialUser sender, ChatChannel channel, Set<Audience> viewers, Component message, String rawMessage, Integer replyId, SignedMessage signedMessage) Constructs a new registered message context. -
Method Summary
Methods inherited from class ovh.mythmc.social.api.context.SocialMessageContext
isReply, signedMessage
-
Constructor Details
-
SocialRegisteredMessageContext
public SocialRegisteredMessageContext(int id, long timestamp, SocialUser sender, ChatChannel channel, Set<Audience> viewers, Component message, String rawMessage, Integer replyId, SignedMessage signedMessage) Constructs a new registered message context.- Parameters:
id- the unique message IDtimestamp- the creation timestamp in milliseconds since epochsender- the message senderchannel- the channel the message was sent inviewers- the audiences who received the messagemessage- the processed message componentrawMessage- the raw, unprocessed message contentreplyId- the ID of the replied message, ornullsignedMessage- the signed message payload, ornull
-
-
Method Details
-
date
Formats the message timestamp into a human-readable date string.The format pattern is retrieved from the configuration:
Social.get().getConfig().getGeneral().getDateFormat().- Returns:
- the formatted date string
-