3ed11047b3cab688b509cc097dac557d90019806
[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 _0xa832=['emit','hasOwnProperty','exports','../../mysqldb','SmsQueue','setMaxListeners','update'];(function(_0x480843,_0x8121e6){var _0x1d5cd9=function(_0x54ca2a){while(--_0x54ca2a){_0x480843['push'](_0x480843['shift']());}};_0x1d5cd9(++_0x8121e6);}(_0xa832,0x16f));var _0x2a83=function(_0x849fd8,_0xf76b4d){_0x849fd8=_0x849fd8-0x0;var _0x2b2c37=_0xa832[_0x849fd8];return _0x2b2c37;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0x2a83('0x0'))['db'][_0x2a83('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x2a83('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2a83('0x3'),'afterDestroy':'remove'};function emitEvent(_0x21936c){return function(_0x38f546,_0x51294c,_0x4744d8){SmsQueueEvents[_0x2a83('0x4')](_0x21936c+':'+_0x38f546['id'],_0x38f546);SmsQueueEvents['emit'](_0x21936c,_0x38f546);_0x4744d8(null);};}for(var e in events){if(events[_0x2a83('0x5')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0x2a83('0x6')]=SmsQueueEvents;