Built motion from commit e02f907f.|2.6.14
[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 _0xdab3=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x186ac2,_0x58de28){var _0x155b7c=function(_0x364483){while(--_0x364483){_0x186ac2['push'](_0x186ac2['shift']());}};_0x155b7c(++_0x58de28);}(_0xdab3,0xeb));var _0x3dab=function(_0x2db677,_0x2372ba){_0x2db677=_0x2db677-0x0;var _0x2e1f9f=_0xdab3[_0x2db677];return _0x2e1f9f;};'use strict';var EventEmitter=require(_0x3dab('0x0'));var SmsQueue=require(_0x3dab('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x3dab('0x2')](0x0);var events={'afterCreate':_0x3dab('0x3'),'afterUpdate':_0x3dab('0x4'),'afterDestroy':_0x3dab('0x5')};function emitEvent(_0xa35957){return function(_0x1e357e,_0x5f348a,_0x5c69b7){SmsQueueEvents[_0x3dab('0x6')](_0xa35957+':'+_0x1e357e['id'],_0x1e357e);SmsQueueEvents[_0x3dab('0x6')](_0xa35957,_0x1e357e);_0x5c69b7(null);};}for(var e in events){if(events[_0x3dab('0x7')](e)){var event=events[e];SmsQueue[_0x3dab('0x8')](e,emitEvent(event));}}module[_0x3dab('0x9')]=SmsQueueEvents;