Built motion from commit 85328c08.|2.5.50
[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 _0x1eb4=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save'];(function(_0x45fc6a,_0x166adb){var _0x14bcfd=function(_0x3ba718){while(--_0x3ba718){_0x45fc6a['push'](_0x45fc6a['shift']());}};_0x14bcfd(++_0x166adb);}(_0x1eb4,0xca));var _0x41eb=function(_0x1d9789,_0x102519){_0x1d9789=_0x1d9789-0x0;var _0x2fb74b=_0x1eb4[_0x1d9789];return _0x2fb74b;};'use strict';var EventEmitter=require(_0x41eb('0x0'));var OpenchannelQueue=require(_0x41eb('0x1'))['db'][_0x41eb('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x41eb('0x3')](0x0);var events={'afterCreate':_0x41eb('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x88ac82){return function(_0x1730b5,_0x398a84,_0x5da94b){OpenchannelQueueEvents[_0x41eb('0x5')](_0x88ac82+':'+_0x1730b5['id'],_0x1730b5);OpenchannelQueueEvents[_0x41eb('0x5')](_0x88ac82,_0x1730b5);_0x5da94b(null);};}for(var e in events){if(events[_0x41eb('0x6')](e)){var event=events[e];OpenchannelQueue[_0x41eb('0x7')](e,emitEvent(event));}}module[_0x41eb('0x8')]=OpenchannelQueueEvents;