Built motion from commit 6362bb75.|2.6.13
[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 _0xf715=['../../mysqldb','SmsQueue','setMaxListeners','save','update','remove','emit','exports','events'];(function(_0x442186,_0x2c8da0){var _0x1037a4=function(_0x1d4526){while(--_0x1d4526){_0x442186['push'](_0x442186['shift']());}};_0x1037a4(++_0x2c8da0);}(_0xf715,0xc5));var _0x5f71=function(_0x426c98,_0x40f6ff){_0x426c98=_0x426c98-0x0;var _0x3bf1c9=_0xf715[_0x426c98];return _0x3bf1c9;};'use strict';var EventEmitter=require(_0x5f71('0x0'));var SmsQueue=require(_0x5f71('0x1'))['db'][_0x5f71('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x5f71('0x3')](0x0);var events={'afterCreate':_0x5f71('0x4'),'afterUpdate':_0x5f71('0x5'),'afterDestroy':_0x5f71('0x6')};function emitEvent(_0x2e4b2e){return function(_0x2f6831,_0x4b3ce9,_0x4ff5be){SmsQueueEvents[_0x5f71('0x7')](_0x2e4b2e+':'+_0x2f6831['id'],_0x2f6831);SmsQueueEvents[_0x5f71('0x7')](_0x2e4b2e,_0x2f6831);_0x4ff5be(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0x5f71('0x8')]=SmsQueueEvents;