mirror of
https://github.com/Mibew/mibew.git
synced 2025-03-01 01:24:32 +03:00
Add "invitationIgnore" event
This commit is contained in:
parent
f070a121fe
commit
445a5866ad
@ -98,6 +98,16 @@ final class Events
|
|||||||
*/
|
*/
|
||||||
const INVITATION_REJECT = 'invitationReject';
|
const INVITATION_REJECT = 'invitationReject';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An invitation is ignored.
|
||||||
|
*
|
||||||
|
* This event is triggered after an invitation has been ignored by a
|
||||||
|
* visitor and automatically closed by the system. An associative array with
|
||||||
|
* the following items is passed to the event handlers:
|
||||||
|
* - "invitation": an instance of {@link \Mibew\Thread} class.
|
||||||
|
*/
|
||||||
|
const INVITATION_IGNORE = 'invitationIgnore';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An operator cannot be authenticated.
|
* An operator cannot be authenticated.
|
||||||
*
|
*
|
||||||
|
@ -245,7 +245,9 @@ function invitation_reject($visitor_id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Close old invitations
|
* Close old invitations.
|
||||||
|
*
|
||||||
|
* Triggers {@link \Mibew\EventDispatcher\Events::INVITATION_IGNORE} event.
|
||||||
*/
|
*/
|
||||||
function invitation_close_old()
|
function invitation_close_old()
|
||||||
{
|
{
|
||||||
@ -294,6 +296,10 @@ function invitation_close_old()
|
|||||||
Thread::KIND_FOR_AGENT,
|
Thread::KIND_FOR_AGENT,
|
||||||
getlocal('Visitor ignored invitation and it was closed automatically', null, $thread->locale, true)
|
getlocal('Visitor ignored invitation and it was closed automatically', null, $thread->locale, true)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$args = array('invitation' => $thread);
|
||||||
|
EventDispatcher::getInstance()->triggerEvent(Events::INVITATION_IGNORE, $args);
|
||||||
|
|
||||||
unset($thread);
|
unset($thread);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user