Built motion from commit 3c2ce842.|2.6.31
[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 _0x6f32=['hasOwnProperty','exports','events','SmsQueue','setMaxListeners','save','update','remove','emit'];(function(_0x1fd027,_0x3d46ce){var _0x20678a=function(_0x5e312f){while(--_0x5e312f){_0x1fd027['push'](_0x1fd027['shift']());}};_0x20678a(++_0x3d46ce);}(_0x6f32,0x1c4));var _0x26f3=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x6f32[_0x3e5086];return _0xfeb102;};'use strict';var EventEmitter=require(_0x26f3('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0x26f3('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x26f3('0x2')](0x0);var events={'afterCreate':_0x26f3('0x3'),'afterUpdate':_0x26f3('0x4'),'afterDestroy':_0x26f3('0x5')};function emitEvent(_0x1a3f0e){return function(_0x4931a7,_0x1cbb52,_0x1b4790){SmsQueueEvents[_0x26f3('0x6')](_0x1a3f0e+':'+_0x4931a7['id'],_0x4931a7);SmsQueueEvents['emit'](_0x1a3f0e,_0x4931a7);_0x1b4790(null);};}for(var e in events){if(events[_0x26f3('0x7')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0x26f3('0x8')]=SmsQueueEvents;