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 _0xb77c=['save','update','remove','emit','hasOwnProperty','hook','exports','events','SmsQueue','setMaxListeners'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xb77c,0x101));var _0xcb77=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0xb77c[_0x263a74];return _0x2aa86c;};'use strict';var EventEmitter=require(_0xcb77('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0xcb77('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xcb77('0x2')](0x0);var events={'afterCreate':_0xcb77('0x3'),'afterUpdate':_0xcb77('0x4'),'afterDestroy':_0xcb77('0x5')};function emitEvent(_0x2cd4ab){return function(_0x422238,_0x4c156a,_0x3e124a){SmsQueueEvents[_0xcb77('0x6')](_0x2cd4ab+':'+_0x422238['id'],_0x422238);SmsQueueEvents[_0xcb77('0x6')](_0x2cd4ab,_0x422238);_0x3e124a(null);};}for(var e in events){if(events[_0xcb77('0x7')](e)){var event=events[e];SmsQueue[_0xcb77('0x8')](e,emitEvent(event));}}module[_0xcb77('0x9')]=SmsQueueEvents;