mirror of
https://github.com/Mibew/mibew.git
synced 2024-11-15 16:44:11 +03:00
Add "invitationAccept" event
This commit is contained in:
parent
5ad1044dc0
commit
b83cb193f1
@ -60,6 +60,16 @@ final class Events
|
||||
*/
|
||||
const INVITATION_CREATE = 'invitationCreate';
|
||||
|
||||
/**
|
||||
* An invitation is accepted.
|
||||
*
|
||||
* This event is triggered after an invitation has been accepted by a
|
||||
* visitor. An associative array with the following items is passed to the
|
||||
* event handlers:
|
||||
* - "invitation": an instance of {@link \Mibew\Thread} class.
|
||||
*/
|
||||
const INVITATION_ACCEPT = 'invitationAccept';
|
||||
|
||||
/**
|
||||
* An operator cannot be authenticated.
|
||||
*
|
||||
|
@ -151,6 +151,8 @@ function invitation_invite($visitor_id, $operator)
|
||||
/**
|
||||
* Invitation was accepted by visitor
|
||||
*
|
||||
* Triggers {@link \Mibew\EventDispatcher\Events::INVITATION_ACCEPT} event.
|
||||
*
|
||||
* @param int $visitor_id ID of the visitor who accept invitation
|
||||
* @return Thread|boolean Thread object or boolean false on failure
|
||||
*/
|
||||
@ -195,6 +197,9 @@ function invitation_accept($visitor_id)
|
||||
array(':visitor_id' => $visitor_id)
|
||||
);
|
||||
|
||||
$args = array('invitation' => $thread);
|
||||
EventDispatcher::getInstance()->triggerEvent(Events::INVITATION_ACCEPT, $args);
|
||||
|
||||
return $thread;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user