Built motion from commit da617fac.|2.6.6
[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 _0x24e3=['events','SmsQueue','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x2ddd6a,_0x35f85a){var _0x476962=function(_0x5c4b76){while(--_0x5c4b76){_0x2ddd6a['push'](_0x2ddd6a['shift']());}};_0x476962(++_0x35f85a);}(_0x24e3,0x168));var _0x324e=function(_0x41dbab,_0x1a343f){_0x41dbab=_0x41dbab-0x0;var _0x499930=_0x24e3[_0x41dbab];return _0x499930;};'use strict';var EventEmitter=require(_0x324e('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0x324e('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x324e('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x324e('0x3'),'afterDestroy':_0x324e('0x4')};function emitEvent(_0x54d939){return function(_0x5f1364,_0x1194b5,_0x1cfa39){SmsQueueEvents[_0x324e('0x5')](_0x54d939+':'+_0x5f1364['id'],_0x5f1364);SmsQueueEvents[_0x324e('0x5')](_0x54d939,_0x5f1364);_0x1cfa39(null);};}for(var e in events){if(events[_0x324e('0x6')](e)){var event=events[e];SmsQueue[_0x324e('0x7')](e,emitEvent(event));}}module[_0x324e('0x8')]=SmsQueueEvents;