1b416bb73c20014be127cda67866835f33bc5ee8
[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 _0x1dc2=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatQueue','setMaxListeners'];(function(_0x1da9f9,_0x3b96e3){var _0x3d0bde=function(_0x51bfd3){while(--_0x51bfd3){_0x1da9f9['push'](_0x1da9f9['shift']());}};_0x3d0bde(++_0x3b96e3);}(_0x1dc2,0xb0));var _0x21dc=function(_0x1575d4,_0x3563da){_0x1575d4=_0x1575d4-0x0;var _0x17d732=_0x1dc2[_0x1575d4];return _0x17d732;};'use strict';var EventEmitter=require(_0x21dc('0x0'));var ChatQueue=require(_0x21dc('0x1'))['db'][_0x21dc('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x21dc('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x21dc('0x4'),'afterDestroy':_0x21dc('0x5')};function emitEvent(_0x135c72){return function(_0x328896,_0x2353e6,_0x6f8b79){ChatQueueEvents[_0x21dc('0x6')](_0x135c72+':'+_0x328896['id'],_0x328896);ChatQueueEvents[_0x21dc('0x6')](_0x135c72,_0x328896);_0x6f8b79(null);};}for(var e in events){if(events[_0x21dc('0x7')](e)){var event=events[e];ChatQueue[_0x21dc('0x8')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;