Built motion from commit 953226e6.|2.6.32
[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 _0xbede=['exports','events','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x2e5597,_0x305053){var _0x2afecb=function(_0xbc8cba){while(--_0xbc8cba){_0x2e5597['push'](_0x2e5597['shift']());}};_0x2afecb(++_0x305053);}(_0xbede,0x151));var _0xebed=function(_0x4c4213,_0x12fa78){_0x4c4213=_0x4c4213-0x0;var _0x5e95cf=_0xbede[_0x4c4213];return _0x5e95cf;};'use strict';var EventEmitter=require(_0xebed('0x0'));var SmsQueue=require('../../mysqldb')['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xebed('0x1'),'afterUpdate':_0xebed('0x2'),'afterDestroy':_0xebed('0x3')};function emitEvent(_0x29784a){return function(_0x2a802c,_0x1888bc,_0xd30d3c){SmsQueueEvents[_0xebed('0x4')](_0x29784a+':'+_0x2a802c['id'],_0x2a802c);SmsQueueEvents[_0xebed('0x4')](_0x29784a,_0x2a802c);_0xd30d3c(null);};}for(var e in events){if(events[_0xebed('0x5')](e)){var event=events[e];SmsQueue[_0xebed('0x6')](e,emitEvent(event));}}module[_0xebed('0x7')]=SmsQueueEvents;