public static interface Conversation.MessageModifierDelegate
Creating a delegate is optional, and can be used to implement callbacks when messages are sent or received.
Setting this delegate can have large consequences on the way messages are displayed to the user.
When setting MessageModifierDelegate
, all delegate methods must be implemented as per their documentation.
Modifier and Type | Method and Description |
---|---|
Message |
beforeDisplay(Message message)
Allows a delegate to modify the contents of a message before it's displayed in the conversation view.
|
Message |
beforeNotification(Message message)
Allows a delegate to modify the contents of a message before it's displayed in a notification.
|
Message |
beforeSend(Message message)
Allows a delegate to modify the contents of a message before sending to Smooch servers.
|
Message beforeSend(Message message)
You should always return a message here. Returning null will result in a NullPointerException
.
When the message type is file
or image
, only the message metadata
may be updated.
Other message properties such as type
or text
won't be considered.
message
- The message being sent.Message
Message beforeDisplay(Message message)
message
- The message being displayed.null
to hide the message.Message
Message beforeNotification(Message message)
message
- The message being displayed in the notification.null
prevent the notification.Message