ChatMessageListener
com.boldchat.visitor.api
Interface ChatMessageListener
-
public interface ChatMessageListener
The listener that will receive events about new messages added to the chat. These methods could be called any time afterChat.startChat(ChatStartListener)
and may continue receiving events untilChat.finishChat(ChatFinishedListener)
is called.
-
-
Method Summary
Methods Modifier and Type Method and Description void
onAutoMessage(java.lang.String text)
When a chat window setup has an auto message configured this method will be called with the text of the auto message.void
onMessageAdded(Message message)
This is called when the server has processed a new chat message, the message may have been sent by thePersonType.Visitor
,PersonType.Operator
, or thePersonType.System
.void
onPreliminaryMessageAdded(Message message)
This is called after a message has been sent to the server, but the response from the server has not yet been received.
-
-
-
Method Detail
-
onPreliminaryMessageAdded
void onPreliminaryMessageAdded(Message message)
This is called after a message has been sent to the server, but the response from the server has not yet been received. This is called immediately afterChat.sendMessage(String, long)
is called. The purpose of this method is to provide a more responsive user interface by adding visitor messages to the chat history area before they have been fully acknowledged by the server.- Parameters:
message
- The message that was sent to the server.
-
onMessageAdded
void onMessageAdded(Message message)
This is called when the server has processed a new chat message, the message may have been sent by thePersonType.Visitor
,PersonType.Operator
, or thePersonType.System
. This message may have already been sent toonPreliminaryMessageAdded(Message)
, but it is unlikely to be the same object instance, soMessage.getMessageID()
should be checked to compare the objects.- Parameters:
message
- The message that has been processed by the server and added to the chat.
-
onAutoMessage
void onAutoMessage(java.lang.String text)
When a chat window setup has an auto message configured this method will be called with the text of the auto message. This text should replace any status message that is displayed, as well as replacing any auto message already being displayed. This text should only be displayed if the chat is not yet answered, and should be removed after the chat has been answered.- Parameters:
text
- The auto-message text.
-
-