Built motion from commit 0900f080.|2.5.45
[motion2.git] / server / api / openchannelQueue / openchannelQueue.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 _0xb89c=['hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','update','remove','emit'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xb89c,0x1c4));var _0xcb89=function(_0xe7ac50,_0x51fed6){_0xe7ac50=_0xe7ac50-0x0;var _0x46f6e3=_0xb89c[_0xe7ac50];return _0x46f6e3;};'use strict';var EventEmitter=require(_0xcb89('0x0'));var OpenchannelQueue=require(_0xcb89('0x1'))['db'][_0xcb89('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xcb89('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xcb89('0x4'),'afterDestroy':_0xcb89('0x5')};function emitEvent(_0x3b780d){return function(_0x52e58b,_0x3e1e11,_0x31eae8){OpenchannelQueueEvents[_0xcb89('0x6')](_0x3b780d+':'+_0x52e58b['id'],_0x52e58b);OpenchannelQueueEvents[_0xcb89('0x6')](_0x3b780d,_0x52e58b);_0x31eae8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0xcb89('0x7')](e,emitEvent(event));}}module[_0xcb89('0x8')]=OpenchannelQueueEvents;