Built motion from commit d13fb11b.|2.6.34
[motion2.git] / server / api / chatQueue / chatQueue.events.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0xe678=['hasOwnProperty','hook','exports','events','ChatQueue','setMaxListeners','emit'];(function(_0x53973c,_0x1f910a){var _0x2fe204=function(_0x4f4817){while(--_0x4f4817){_0x53973c['push'](_0x53973c['shift']());}};_0x2fe204(++_0x1f910a);}(_0xe678,0x13e));var _0x8e67=function(_0x22a3b7,_0xac8090){_0x22a3b7=_0x22a3b7-0x0;var _0x30845c=_0xe678[_0x22a3b7];return _0x30845c;};'use strict';var EventEmitter=require(_0x8e67('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x8e67('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x8e67('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x504f83){return function(_0x3cffb6,_0xd08dd0,_0x53cf8e){ChatQueueEvents['emit'](_0x504f83+':'+_0x3cffb6['id'],_0x3cffb6);ChatQueueEvents[_0x8e67('0x3')](_0x504f83,_0x3cffb6);_0x53cf8e(null);};}for(var e in events){if(events[_0x8e67('0x4')](e)){var event=events[e];ChatQueue[_0x8e67('0x5')](e,emitEvent(event));}}module[_0x8e67('0x6')]=ChatQueueEvents;