1 // *************************************************************************
3 // * xCALLY Motion - The Omnichannel Contact Center *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved *
6 // *************************************************************************
8 // * Email: info@xcally.com *
9 // * Website: https://www.xcally.com *
11 // *************************************************************************
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. *
17 // *************************************************************************
18 var _0xfa07=['../../mysqldb','SmsQueue','save','update','emit','hasOwnProperty','hook','events'];(function(_0x5a3340,_0x5b7a94){var _0x101985=function(_0x124f9c){while(--_0x124f9c){_0x5a3340['push'](_0x5a3340['shift']());}};_0x101985(++_0x5b7a94);}(_0xfa07,0x177));var _0x7fa0=function(_0x595e22,_0x5f2c86){_0x595e22=_0x595e22-0x0;var _0x5b98ca=_0xfa07[_0x595e22];return _0x5b98ca;};'use strict';var EventEmitter=require(_0x7fa0('0x0'));var SmsQueue=require(_0x7fa0('0x1'))['db'][_0x7fa0('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7fa0('0x3'),'afterUpdate':_0x7fa0('0x4'),'afterDestroy':'remove'};function emitEvent(_0x49c4fa){return function(_0x1ad4b0,_0x172ecb,_0x51fb31){SmsQueueEvents[_0x7fa0('0x5')](_0x49c4fa+':'+_0x1ad4b0['id'],_0x1ad4b0);SmsQueueEvents[_0x7fa0('0x5')](_0x49c4fa,_0x1ad4b0);_0x51fb31(null);};}for(var e in events){if(events[_0x7fa0('0x6')](e)){var event=events[e];SmsQueue[_0x7fa0('0x7')](e,emitEvent(event));}}module['exports']=SmsQueueEvents;