c45a0fa444ad5d18e044277979531f92aac4e745
[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 _0x818f=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatQueue','setMaxListeners'];(function(_0x161872,_0xea11d4){var _0x259cdd=function(_0x39378f){while(--_0x39378f){_0x161872['push'](_0x161872['shift']());}};_0x259cdd(++_0xea11d4);}(_0x818f,0x1a0));var _0xf818=function(_0x5d597a,_0x561ee3){_0x5d597a=_0x5d597a-0x0;var _0x3211b3=_0x818f[_0x5d597a];return _0x3211b3;};'use strict';var EventEmitter=require(_0xf818('0x0'));var ChatQueue=require(_0xf818('0x1'))['db'][_0xf818('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xf818('0x3')](0x0);var events={'afterCreate':_0xf818('0x4'),'afterUpdate':_0xf818('0x5'),'afterDestroy':_0xf818('0x6')};function emitEvent(_0x3a6df4){return function(_0x515b79,_0x4e24e9,_0x3e1b07){ChatQueueEvents[_0xf818('0x7')](_0x3a6df4+':'+_0x515b79['id'],_0x515b79);ChatQueueEvents[_0xf818('0x7')](_0x3a6df4,_0x515b79);_0x3e1b07(null);};}for(var e in events){if(events[_0xf818('0x8')](e)){var event=events[e];ChatQueue[_0xf818('0x9')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;