Built motion from commit (unavailable).|2.5.0
[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 _0x699c=['save','update','emit','hasOwnProperty','exports','events','../../mysqldb','SmsQueue','setMaxListeners'];(function(_0x36512c,_0x10b179){var _0x4be856=function(_0x4a4a6d){while(--_0x4a4a6d){_0x36512c['push'](_0x36512c['shift']());}};_0x4be856(++_0x10b179);}(_0x699c,0xdd));var _0xc699=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x699c[_0x167cc1];return _0x10bc4b;};'use strict';var EventEmitter=require(_0xc699('0x0'));var SmsQueue=require(_0xc699('0x1'))['db'][_0xc699('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xc699('0x3')](0x0);var events={'afterCreate':_0xc699('0x4'),'afterUpdate':_0xc699('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1f761f){return function(_0x1990a8,_0x46d94d,_0x48bd3e){SmsQueueEvents[_0xc699('0x6')](_0x1f761f+':'+_0x1990a8['id'],_0x1990a8);SmsQueueEvents[_0xc699('0x6')](_0x1f761f,_0x1990a8);_0x48bd3e(null);};}for(var e in events){if(events[_0xc699('0x7')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0xc699('0x8')]=SmsQueueEvents;