054f992f15b579761cbb8210dce1e2b707c7e5b1
[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 _0x319c=['hasOwnProperty','hook','events','../../mysqldb','SmsQueue','save','update','remove','emit'];(function(_0x6ec9cd,_0x278cc0){var _0x55fc63=function(_0x21c6c0){while(--_0x21c6c0){_0x6ec9cd['push'](_0x6ec9cd['shift']());}};_0x55fc63(++_0x278cc0);}(_0x319c,0x173));var _0xc319=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x319c[_0x243b59];return _0x3e1676;};'use strict';var EventEmitter=require(_0xc319('0x0'));var SmsQueue=require(_0xc319('0x1'))['db'][_0xc319('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc319('0x3'),'afterUpdate':_0xc319('0x4'),'afterDestroy':_0xc319('0x5')};function emitEvent(_0x3f3b39){return function(_0x16467a,_0x4ab5cc,_0x2aca41){SmsQueueEvents[_0xc319('0x6')](_0x3f3b39+':'+_0x16467a['id'],_0x16467a);SmsQueueEvents[_0xc319('0x6')](_0x3f3b39,_0x16467a);_0x2aca41(null);};}for(var e in events){if(events[_0xc319('0x7')](e)){var event=events[e];SmsQueue[_0xc319('0x8')](e,emitEvent(event));}}module['exports']=SmsQueueEvents;