Built motion from commit eddce310.|2.6.12
[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 _0x806c=['../../mysqldb','SmsQueue','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x4a0c8d,_0x404644){var _0x84c411=function(_0x3839f3){while(--_0x3839f3){_0x4a0c8d['push'](_0x4a0c8d['shift']());}};_0x84c411(++_0x404644);}(_0x806c,0x17b));var _0xc806=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x806c[_0x2a6809];return _0x11c371;};'use strict';var EventEmitter=require(_0xc806('0x0'));var SmsQueue=require(_0xc806('0x1'))['db'][_0xc806('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc806('0x3'),'afterUpdate':_0xc806('0x4'),'afterDestroy':_0xc806('0x5')};function emitEvent(_0x1a47f7){return function(_0x5786e7,_0x299768,_0x456633){SmsQueueEvents[_0xc806('0x6')](_0x1a47f7+':'+_0x5786e7['id'],_0x5786e7);SmsQueueEvents[_0xc806('0x6')](_0x1a47f7,_0x5786e7);_0x456633(null);};}for(var e in events){if(events[_0xc806('0x7')](e)){var event=events[e];SmsQueue[_0xc806('0x8')](e,emitEvent(event));}}module[_0xc806('0x9')]=SmsQueueEvents;