Conversation Filter

Documentation → Conversation Filter

The Conversation Filter Plugin allows you to display any message in your own javascript handler before the IM window launches and after the IM windows closes.

Add the plugin by letting the Userplane API know you require the plugin:

   onReady = function () {
	up.api.require("ConversationFilter", {closeHandler:closeHandler,startHandler:startHandler});
  }
  up.api.addEventListener(up.api.events.READY,onReady);

You must pass the plugin a config which contains both a closeHandler and a startHandler which are javascript functions which will be sent a ConversationCloseEvent and ConversationStartEvent respectively.

Config Parameters

Parameter Optional/Required Default Description
closeHandler required   Handler function to receive all ConversationCloseEvent generated by the SDK. This handler will have priority receiving the event before any other widget or service so you can manipulate the events before they propagate.
startHandler required   Handler function to receive all ConversationStartEvent generated by the SDK. This handler will have priority receiving the event before any other widget or service so you can manipulate the events before they propagate.