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 _0xfc46=['exports','events','../../mysqldb','SmsQueue','setMaxListeners','save','emit','hook'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xfc46,0xb1));var _0x6fc4=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xfc46[_0x521929];return _0x632436;};'use strict';var EventEmitter=require(_0x6fc4('0x0'));var SmsQueue=require(_0x6fc4('0x1'))['db'][_0x6fc4('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x6fc4('0x3')](0x0);var events={'afterCreate':_0x6fc4('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x29b264){return function(_0x430088,_0x6fe8a8,_0x2de096){SmsQueueEvents[_0x6fc4('0x5')](_0x29b264+':'+_0x430088['id'],_0x430088);SmsQueueEvents[_0x6fc4('0x5')](_0x29b264,_0x430088);_0x2de096(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0x6fc4('0x6')](e,emitEvent(event));}}module[_0x6fc4('0x7')]=SmsQueueEvents;