Built motion from commit ffdca78c.|2.6.24
[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 _0x0eb3=['OpenchannelQueue','update','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x24a90a,_0x40e57e){var _0x1fb916=function(_0x57d47f){while(--_0x57d47f){_0x24a90a['push'](_0x24a90a['shift']());}};_0x1fb916(++_0x40e57e);}(_0x0eb3,0x1b8));var _0x30eb=function(_0x53d12e,_0x444acf){_0x53d12e=_0x53d12e-0x0;var _0x15fd5c=_0x0eb3[_0x53d12e];return _0x15fd5c;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x30eb('0x0'))['db'][_0x30eb('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x30eb('0x2'),'afterDestroy':'remove'};function emitEvent(_0x3cdd0a){return function(_0x414a48,_0x5f2950,_0x83c041){OpenchannelQueueEvents[_0x30eb('0x3')](_0x3cdd0a+':'+_0x414a48['id'],_0x414a48);OpenchannelQueueEvents['emit'](_0x3cdd0a,_0x414a48);_0x83c041(null);};}for(var e in events){if(events[_0x30eb('0x4')](e)){var event=events[e];OpenchannelQueue[_0x30eb('0x5')](e,emitEvent(event));}}module[_0x30eb('0x6')]=OpenchannelQueueEvents;