mirror of
https://github.com/Mibew/mibew.git
synced 2025-02-12 02:21:09 +03:00
Add THREAD_USER_IS_READY event
This commit is contained in:
parent
227c7a9410
commit
8457e51717
@ -18,6 +18,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
use Mibew\Asset\Generator\UrlGeneratorInterface as AssetUrlGeneratorInterface;
|
use Mibew\Asset\Generator\UrlGeneratorInterface as AssetUrlGeneratorInterface;
|
||||||
|
use Mibew\EventDispatcher\EventDispatcher;
|
||||||
|
use Mibew\EventDispatcher\Events;
|
||||||
use Mibew\Settings;
|
use Mibew\Settings;
|
||||||
use Mibew\Thread;
|
use Mibew\Thread;
|
||||||
use Mibew\Style\ChatStyle;
|
use Mibew\Style\ChatStyle;
|
||||||
@ -717,5 +719,10 @@ function chat_start_for_user(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Let plugins know that user is ready to chat.
|
||||||
|
$dispatcher = EventDispatcher::getInstance();
|
||||||
|
$event_args = array('thread' => $thread);
|
||||||
|
$dispatcher->triggerEvent(Events::THREAD_USER_IS_READY, $event_args);
|
||||||
|
|
||||||
return $thread;
|
return $thread;
|
||||||
}
|
}
|
||||||
|
@ -414,6 +414,18 @@ final class Events
|
|||||||
*/
|
*/
|
||||||
const THREAD_GET_MESSAGES_ALTER = 'threadGetMessagesAlter';
|
const THREAD_GET_MESSAGES_ALTER = 'threadGetMessagesAlter';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* User is ready to chat.
|
||||||
|
*
|
||||||
|
* This event is triggered after the thread is created, the user passed
|
||||||
|
* pre-chat survey and all system messages are sent to him. This event is
|
||||||
|
* not triggered if there are no online operators and the chat cannot be
|
||||||
|
* started. An associative array with the following items is passed to the
|
||||||
|
* event handlers:
|
||||||
|
* - "thread": an instance of {@link \Mibew\Thread}.
|
||||||
|
*/
|
||||||
|
const THREAD_USER_IS_READY = 'threadUserIsReady';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Threads list is ready to be sent to client.
|
* Threads list is ready to be sent to client.
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user