Built motion from commit a61a4a20.|2.5.46
[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 _0xac5c=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners'];(function(_0x187399,_0x40c56d){var _0x40fa92=function(_0x36058c){while(--_0x36058c){_0x187399['push'](_0x187399['shift']());}};_0x40fa92(++_0x40c56d);}(_0xac5c,0x178));var _0xcac5=function(_0x273978,_0x1e04fe){_0x273978=_0x273978-0x0;var _0x2d9d00=_0xac5c[_0x273978];return _0x2d9d00;};'use strict';var EventEmitter=require(_0xcac5('0x0'));var OpenchannelQueue=require(_0xcac5('0x1'))['db'][_0xcac5('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xcac5('0x3')](0x0);var events={'afterCreate':_0xcac5('0x4'),'afterUpdate':_0xcac5('0x5'),'afterDestroy':'remove'};function emitEvent(_0x363dc7){return function(_0xc38785,_0x25c07a,_0x13c69a){OpenchannelQueueEvents[_0xcac5('0x6')](_0x363dc7+':'+_0xc38785['id'],_0xc38785);OpenchannelQueueEvents[_0xcac5('0x6')](_0x363dc7,_0xc38785);_0x13c69a(null);};}for(var e in events){if(events[_0xcac5('0x7')](e)){var event=events[e];OpenchannelQueue[_0xcac5('0x8')](e,emitEvent(event));}}module[_0xcac5('0x9')]=OpenchannelQueueEvents;