0c5bdf81ecf2cd7ebbbaac06a414b92ab2bf2934
[motion2.git] / server / api / smsQueue / smsQueue.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 _0x0cec=['update','emit','exports','events','../../mysqldb','SmsQueue','setMaxListeners','save'];(function(_0x5f09f7,_0x7eb7ab){var _0x26d983=function(_0x3d31de){while(--_0x3d31de){_0x5f09f7['push'](_0x5f09f7['shift']());}};_0x26d983(++_0x7eb7ab);}(_0x0cec,0x103));var _0xc0ce=function(_0x97048e,_0x20d7b8){_0x97048e=_0x97048e-0x0;var _0x5324bc=_0x0cec[_0x97048e];return _0x5324bc;};'use strict';var EventEmitter=require(_0xc0ce('0x0'));var SmsQueue=require(_0xc0ce('0x1'))['db'][_0xc0ce('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xc0ce('0x3')](0x0);var events={'afterCreate':_0xc0ce('0x4'),'afterUpdate':_0xc0ce('0x5'),'afterDestroy':'remove'};function emitEvent(_0x21ad93){return function(_0x412d0c,_0x48f978,_0xd14e6c){SmsQueueEvents['emit'](_0x21ad93+':'+_0x412d0c['id'],_0x412d0c);SmsQueueEvents[_0xc0ce('0x6')](_0x21ad93,_0x412d0c);_0xd14e6c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0xc0ce('0x7')]=SmsQueueEvents;