This hook is used to alter the output text by messages or chat. (User message output). Chat and messages have same hook.

~~~
<?php
function my_component_init(){
ossn_add_hook('messages', 'message:smilify', 'my_component_hook');
ossn_add_hook('chat', 'message:smilify', 'my_component_hook');
}
function my_component_hook($hook, $type, $text, $params){
//$text contains the output text
//$params['instance'] contains message item instance example from, to, message(text).
error_log(print_r($params, true));
return $text;
}
ossn_register_callback('ossn', 'init', 'my_component_init');
~~~

Example of the usage is OssnSmilies componnet replacing smilies codes to icons.

Chat or messages text view