Built motion from commit (unavailable).|2.5.17
[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 _0x138a=['emit','hasOwnProperty','hook','exports','events','SmsQueue','setMaxListeners','save','remove'];(function(_0x2caa80,_0x4d2a9){var _0x5acb63=function(_0x3fe9c5){while(--_0x3fe9c5){_0x2caa80['push'](_0x2caa80['shift']());}};_0x5acb63(++_0x4d2a9);}(_0x138a,0xb8));var _0xa138=function(_0x52f139,_0x51c99b){_0x52f139=_0x52f139-0x0;var _0x34b6a6=_0x138a[_0x52f139];return _0x34b6a6;};'use strict';var EventEmitter=require(_0xa138('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0xa138('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xa138('0x2')](0x0);var events={'afterCreate':_0xa138('0x3'),'afterUpdate':'update','afterDestroy':_0xa138('0x4')};function emitEvent(_0x537c5a){return function(_0x1647aa,_0x4ecd70,_0x2ff2b4){SmsQueueEvents[_0xa138('0x5')](_0x537c5a+':'+_0x1647aa['id'],_0x1647aa);SmsQueueEvents[_0xa138('0x5')](_0x537c5a,_0x1647aa);_0x2ff2b4(null);};}for(var e in events){if(events[_0xa138('0x6')](e)){var event=events[e];SmsQueue[_0xa138('0x7')](e,emitEvent(event));}}module[_0xa138('0x8')]=SmsQueueEvents;