f5b6b75f50233b31442ab4695033c4ef2b556308
[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 _0xc574=['hook','exports','events','../../mysqldb','ChatQueue','save','update','remove','emit'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xc574,0x107));var _0x4c57=function(_0x4b3ba9,_0x4ed581){_0x4b3ba9=_0x4b3ba9-0x0;var _0x54d522=_0xc574[_0x4b3ba9];return _0x54d522;};'use strict';var EventEmitter=require(_0x4c57('0x0'));var ChatQueue=require(_0x4c57('0x1'))['db'][_0x4c57('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4c57('0x3'),'afterUpdate':_0x4c57('0x4'),'afterDestroy':_0x4c57('0x5')};function emitEvent(_0x468b6d){return function(_0x2422b7,_0x4e509c,_0x6e8fb1){ChatQueueEvents[_0x4c57('0x6')](_0x468b6d+':'+_0x2422b7['id'],_0x2422b7);ChatQueueEvents[_0x4c57('0x6')](_0x468b6d,_0x2422b7);_0x6e8fb1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x4c57('0x7')](e,emitEvent(event));}}module[_0x4c57('0x8')]=ChatQueueEvents;