Built motion from commit (unavailable).|2.5.1
[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 _0x76cc=['../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook','events'];(function(_0x5d20ad,_0x5410e2){var _0x197adf=function(_0xf7c7bf){while(--_0xf7c7bf){_0x5d20ad['push'](_0x5d20ad['shift']());}};_0x197adf(++_0x5410e2);}(_0x76cc,0x117));var _0xc76c=function(_0x33fbd4,_0x1873bc){_0x33fbd4=_0x33fbd4-0x0;var _0x155d8e=_0x76cc[_0x33fbd4];return _0x155d8e;};'use strict';var EventEmitter=require(_0xc76c('0x0'));var SmsQueue=require(_0xc76c('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xc76c('0x2')](0x0);var events={'afterCreate':_0xc76c('0x3'),'afterUpdate':_0xc76c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2319ca){return function(_0x3dad62,_0x209273,_0x2a2824){SmsQueueEvents['emit'](_0x2319ca+':'+_0x3dad62['id'],_0x3dad62);SmsQueueEvents[_0xc76c('0x5')](_0x2319ca,_0x3dad62);_0x2a2824(null);};}for(var e in events){if(events[_0xc76c('0x6')](e)){var event=events[e];SmsQueue[_0xc76c('0x7')](e,emitEvent(event));}}module['exports']=SmsQueueEvents;