Built motion from commit (unavailable).|2.5.9
[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 _0x7a63=['save','remove','emit','exports','../../mysqldb','setMaxListeners'];(function(_0x3200ea,_0x4fb38c){var _0x4b0858=function(_0xe1288b){while(--_0xe1288b){_0x3200ea['push'](_0x3200ea['shift']());}};_0x4b0858(++_0x4fb38c);}(_0x7a63,0xfa));var _0x37a6=function(_0x502433,_0x51d311){_0x502433=_0x502433-0x0;var _0x4e3904=_0x7a63[_0x502433];return _0x4e3904;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0x37a6('0x0'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x37a6('0x1')](0x0);var events={'afterCreate':_0x37a6('0x2'),'afterUpdate':'update','afterDestroy':_0x37a6('0x3')};function emitEvent(_0x4c5cc0){return function(_0x4ef0ed,_0x4bb08a,_0x2b78c1){SmsQueueEvents['emit'](_0x4c5cc0+':'+_0x4ef0ed['id'],_0x4ef0ed);SmsQueueEvents[_0x37a6('0x4')](_0x4c5cc0,_0x4ef0ed);_0x2b78c1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0x37a6('0x5')]=SmsQueueEvents;