Built motion from commit 43538d75.|2.5.35
[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 _0xb9cb=['emit','exports','events','../../mysqldb','SmsQueue','setMaxListeners','save','remove'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0xb9cb,0x6a));var _0xbb9c=function(_0x18776a,_0x4fecab){_0x18776a=_0x18776a-0x0;var _0x484e4a=_0xb9cb[_0x18776a];return _0x484e4a;};'use strict';var EventEmitter=require(_0xbb9c('0x0'));var SmsQueue=require(_0xbb9c('0x1'))['db'][_0xbb9c('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xbb9c('0x3')](0x0);var events={'afterCreate':_0xbb9c('0x4'),'afterUpdate':'update','afterDestroy':_0xbb9c('0x5')};function emitEvent(_0x4c1d8e){return function(_0x5419b9,_0x43dad0,_0x59366e){SmsQueueEvents[_0xbb9c('0x6')](_0x4c1d8e+':'+_0x5419b9['id'],_0x5419b9);SmsQueueEvents[_0xbb9c('0x6')](_0x4c1d8e,_0x5419b9);_0x59366e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0xbb9c('0x7')]=SmsQueueEvents;