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 _0x6aa2=['hook','exports','SmsQueue','save','update','remove','emit','hasOwnProperty'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x6aa2,0xa2));var _0x26aa=function(_0x3fd275,_0xf0cd7){_0x3fd275=_0x3fd275-0x0;var _0xe4f14f=_0x6aa2[_0x3fd275];return _0xe4f14f;};'use strict';var EventEmitter=require('events');var SmsQueue=require('../../mysqldb')['db'][_0x26aa('0x0')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x26aa('0x1'),'afterUpdate':_0x26aa('0x2'),'afterDestroy':_0x26aa('0x3')};function emitEvent(_0x2ab695){return function(_0x522fe5,_0x200d19,_0x1dfdac){SmsQueueEvents['emit'](_0x2ab695+':'+_0x522fe5['id'],_0x522fe5);SmsQueueEvents[_0x26aa('0x4')](_0x2ab695,_0x522fe5);_0x1dfdac(null);};}for(var e in events){if(events[_0x26aa('0x5')](e)){var event=events[e];SmsQueue[_0x26aa('0x6')](e,emitEvent(event));}}module[_0x26aa('0x7')]=SmsQueueEvents;