Built motion from commit 10af8726.|2.6.34
[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 _0xe501=['hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','update','remove'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xe501,0x1e6));var _0x1e50=function(_0x156a0d,_0x3946ce){_0x156a0d=_0x156a0d-0x0;var _0x98a9ba=_0xe501[_0x156a0d];return _0x98a9ba;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0x1e50('0x0'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x1e50('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1e50('0x2'),'afterDestroy':_0x1e50('0x3')};function emitEvent(_0x369ee8){return function(_0x2b0c54,_0x598477,_0x96c0a){SmsQueueEvents['emit'](_0x369ee8+':'+_0x2b0c54['id'],_0x2b0c54);SmsQueueEvents['emit'](_0x369ee8,_0x2b0c54);_0x96c0a(null);};}for(var e in events){if(events[_0x1e50('0x4')](e)){var event=events[e];SmsQueue[_0x1e50('0x5')](e,emitEvent(event));}}module[_0x1e50('0x6')]=SmsQueueEvents;