cc0600c7523f98c7d1da1dcd7faf74eb3a560ebb
[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 _0x7542=['remove','emit','hook','exports','../../mysqldb','SmsQueue','save','update'];(function(_0x12aeab,_0x4dbd24){var _0x1b195c=function(_0x54df5a){while(--_0x54df5a){_0x12aeab['push'](_0x12aeab['shift']());}};_0x1b195c(++_0x4dbd24);}(_0x7542,0x1a4));var _0x2754=function(_0x5f5be3,_0x5bec6e){_0x5f5be3=_0x5f5be3-0x0;var _0xbb0d5e=_0x7542[_0x5f5be3];return _0xbb0d5e;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0x2754('0x0'))['db'][_0x2754('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2754('0x2'),'afterUpdate':_0x2754('0x3'),'afterDestroy':_0x2754('0x4')};function emitEvent(_0x96c5a5){return function(_0x1efb6c,_0x283987,_0x17973d){SmsQueueEvents[_0x2754('0x5')](_0x96c5a5+':'+_0x1efb6c['id'],_0x1efb6c);SmsQueueEvents[_0x2754('0x5')](_0x96c5a5,_0x1efb6c);_0x17973d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0x2754('0x6')](e,emitEvent(event));}}module[_0x2754('0x7')]=SmsQueueEvents;