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 _0xaeb1=['hasOwnProperty','exports','events','../../mysqldb','SmsQueue','setMaxListeners','save','update','remove','emit'];(function(_0x23c23c,_0x5ee1ff){var _0xf99e32=function(_0x16c73f){while(--_0x16c73f){_0x23c23c['push'](_0x23c23c['shift']());}};_0xf99e32(++_0x5ee1ff);}(_0xaeb1,0x1e2));var _0x1aeb=function(_0x23a1f6,_0x3d615b){_0x23a1f6=_0x23a1f6-0x0;var _0x3c42a9=_0xaeb1[_0x23a1f6];return _0x3c42a9;};'use strict';var EventEmitter=require(_0x1aeb('0x0'));var SmsQueue=require(_0x1aeb('0x1'))['db'][_0x1aeb('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x1aeb('0x3')](0x0);var events={'afterCreate':_0x1aeb('0x4'),'afterUpdate':_0x1aeb('0x5'),'afterDestroy':_0x1aeb('0x6')};function emitEvent(_0x1f0ef5){return function(_0xf7c5d3,_0x1f853d,_0x51ab9d){SmsQueueEvents[_0x1aeb('0x7')](_0x1f0ef5+':'+_0xf7c5d3['id'],_0xf7c5d3);SmsQueueEvents[_0x1aeb('0x7')](_0x1f0ef5,_0xf7c5d3);_0x51ab9d(null);};}for(var e in events){if(events[_0x1aeb('0x8')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0x1aeb('0x9')]=SmsQueueEvents;