Built motion from commit 753c950e.|2.5.42
[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 _0x19ae=['hasOwnProperty','hook','exports','events','SmsQueue','setMaxListeners','save','remove','emit'];(function(_0x32443e,_0x2d7d32){var _0x2aa089=function(_0x5d5924){while(--_0x5d5924){_0x32443e['push'](_0x32443e['shift']());}};_0x2aa089(++_0x2d7d32);}(_0x19ae,0x159));var _0xe19a=function(_0x1b3c32,_0x141fb8){_0x1b3c32=_0x1b3c32-0x0;var _0x48d8b9=_0x19ae[_0x1b3c32];return _0x48d8b9;};'use strict';var EventEmitter=require(_0xe19a('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0xe19a('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xe19a('0x2')](0x0);var events={'afterCreate':_0xe19a('0x3'),'afterUpdate':'update','afterDestroy':_0xe19a('0x4')};function emitEvent(_0x2ef050){return function(_0x3ede66,_0xe8d83,_0x2a5ce2){SmsQueueEvents[_0xe19a('0x5')](_0x2ef050+':'+_0x3ede66['id'],_0x3ede66);SmsQueueEvents[_0xe19a('0x5')](_0x2ef050,_0x3ede66);_0x2a5ce2(null);};}for(var e in events){if(events[_0xe19a('0x6')](e)){var event=events[e];SmsQueue[_0xe19a('0x7')](e,emitEvent(event));}}module[_0xe19a('0x8')]=SmsQueueEvents;