Interface MessageSendHelper
-
- All Known Implementing Classes:
DefaultMessageSendHelper
public interface MessageSendHelper- Author:
- Filip Hrisafov
- See Also:
DefaultMessageSendHelper
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description StringrenderMainContent(Conversation conversation, String receivingUserId, String messageKey, String messageCode, String messageLanguage, Map<String,Object> messagePayload)Render the content of the templatevoidscheduleTemporaryMessageHandling(TemporaryMessage temporaryMessage)Schedule the temporary message handling.booleanshouldHandleAsTemporaryMessage(Message message, Conversation conversation)Check whether the message should be handled as a temporary message.default booleanshouldIncreaseUnreadMessageCount(Message message, Conversation conversation)Check whether the unread message count within the given conversation should be inreased for the given messagedefault booleanshouldUpdateConversationLastMessageTime(Message message, Conversation conversation)Check whether the message should trigger an update of the last message time of the conversation.
-
-
-
Method Detail
-
shouldHandleAsTemporaryMessage
boolean shouldHandleAsTemporaryMessage(Message message, Conversation conversation)
Check whether the message should be handled as a temporary message.- Parameters:
message- the messageconversation- the conversation- Returns:
trueif the message should be handled as a temporary message,falseotherwise
-
scheduleTemporaryMessageHandling
void scheduleTemporaryMessageHandling(TemporaryMessage temporaryMessage)
Schedule the temporary message handling.- Parameters:
temporaryMessage- the temporary message
-
shouldUpdateConversationLastMessageTime
default boolean shouldUpdateConversationLastMessageTime(Message message, Conversation conversation)
Check whether the message should trigger an update of the last message time of the conversation.- Parameters:
message- the messageconversation- the conversation- Returns:
truewhen last message time of the conversation should be updated,falseotherwise
-
shouldIncreaseUnreadMessageCount
default boolean shouldIncreaseUnreadMessageCount(Message message, Conversation conversation)
Check whether the unread message count within the given conversation should be inreased for the given message- Parameters:
message- the messageconversation- the conversation- Returns:
truewhen the unread message count should be increased,falseotherwise
-
renderMainContent
String renderMainContent(Conversation conversation, String receivingUserId, String messageKey, String messageCode, String messageLanguage, Map<String,Object> messagePayload)
Render the content of the template- Parameters:
conversation- the conversation where the message is sent toreceivingUserId- the optional user id which receives the message.messageKey- the template key of the message template to be usedmessageCode- the message code to choose the template variation formessageLanguage- the optional language (e.g. "en") for which the message should be rendered. If language is null the default languageTemplateMessageUtil.FALLBACK_LANGUAGEis used.messagePayload- the optional payload containing the necessary parameters (if any needed by the template)- Returns:
- the content of the template
-
-