Built motion from commit 14588770.|2.5.38
[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 _0xda5e=['events','../../mysqldb','SmsQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x2fd608,_0x5670ae){var _0x54f2e8=function(_0x176987){while(--_0x176987){_0x2fd608['push'](_0x2fd608['shift']());}};_0x54f2e8(++_0x5670ae);}(_0xda5e,0xfd));var _0xeda5=function(_0x38d74a,_0x50c071){_0x38d74a=_0x38d74a-0x0;var _0x2f7a94=_0xda5e[_0x38d74a];return _0x2f7a94;};'use strict';var EventEmitter=require(_0xeda5('0x0'));var SmsQueue=require(_0xeda5('0x1'))['db'][_0xeda5('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xeda5('0x3')](0x0);var events={'afterCreate':_0xeda5('0x4'),'afterUpdate':_0xeda5('0x5'),'afterDestroy':_0xeda5('0x6')};function emitEvent(_0x229f92){return function(_0x587f5c,_0x5c7fa5,_0x4ef595){SmsQueueEvents['emit'](_0x229f92+':'+_0x587f5c['id'],_0x587f5c);SmsQueueEvents[_0xeda5('0x7')](_0x229f92,_0x587f5c);_0x4ef595(null);};}for(var e in events){if(events[_0xeda5('0x8')](e)){var event=events[e];SmsQueue[_0xeda5('0x9')](e,emitEvent(event));}}module[_0xeda5('0xa')]=SmsQueueEvents;