cecfb00637b7bd5acd274028c601f41f5eb6ae27
[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 _0x3821=['hook','exports','events','setMaxListeners','remove','emit','hasOwnProperty'];(function(_0x4aa532,_0x4ddf4c){var _0x21181a=function(_0x23d682){while(--_0x23d682){_0x4aa532['push'](_0x4aa532['shift']());}};_0x21181a(++_0x4ddf4c);}(_0x3821,0xf7));var _0x1382=function(_0x1fb22c,_0x4c058e){_0x1fb22c=_0x1fb22c-0x0;var _0x1d9051=_0x3821[_0x1fb22c];return _0x1d9051;};'use strict';var EventEmitter=require(_0x1382('0x0'));var ChatQueue=require('../../mysqldb')['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x1382('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x1382('0x2')};function emitEvent(_0x5ea6bb){return function(_0x1468d3,_0x3272e6,_0x4444e6){ChatQueueEvents[_0x1382('0x3')](_0x5ea6bb+':'+_0x1468d3['id'],_0x1468d3);ChatQueueEvents[_0x1382('0x3')](_0x5ea6bb,_0x1468d3);_0x4444e6(null);};}for(var e in events){if(events[_0x1382('0x4')](e)){var event=events[e];ChatQueue[_0x1382('0x5')](e,emitEvent(event));}}module[_0x1382('0x6')]=ChatQueueEvents;