Built motion from commit (unavailable).|2.5.2
[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 _0xeafa=['SmsQueue','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x45346d,_0xffd56b){var _0x5ce7ca=function(_0x27ce87){while(--_0x27ce87){_0x45346d['push'](_0x45346d['shift']());}};_0x5ce7ca(++_0xffd56b);}(_0xeafa,0xca));var _0xaeaf=function(_0x50e253,_0x2f8ce3){_0x50e253=_0x50e253-0x0;var _0xf1e10a=_0xeafa[_0x50e253];return _0xf1e10a;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0xaeaf('0x0'))['db'][_0xaeaf('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xaeaf('0x2')};function emitEvent(_0x5c2621){return function(_0x3f179e,_0x1a02cf,_0x33bdb8){SmsQueueEvents[_0xaeaf('0x3')](_0x5c2621+':'+_0x3f179e['id'],_0x3f179e);SmsQueueEvents[_0xaeaf('0x3')](_0x5c2621,_0x3f179e);_0x33bdb8(null);};}for(var e in events){if(events[_0xaeaf('0x4')](e)){var event=events[e];SmsQueue[_0xaeaf('0x5')](e,emitEvent(event));}}module[_0xaeaf('0x6')]=SmsQueueEvents;