Built motion from commit a61a4a20.|2.5.46
[motion2.git] / server / api / faxQueue / faxQueue.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 _0x48ce=['hasOwnProperty','hook','exports','events','setMaxListeners','save','update','emit'];(function(_0x5d11a8,_0x12a747){var _0x1c7744=function(_0xb400d1){while(--_0xb400d1){_0x5d11a8['push'](_0x5d11a8['shift']());}};_0x1c7744(++_0x12a747);}(_0x48ce,0x123));var _0xe48c=function(_0x421528,_0x1b84e8){_0x421528=_0x421528-0x0;var _0x494d9f=_0x48ce[_0x421528];return _0x494d9f;};'use strict';var EventEmitter=require(_0xe48c('0x0'));var FaxQueue=require('../../mysqldb')['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xe48c('0x1')](0x0);var events={'afterCreate':_0xe48c('0x2'),'afterUpdate':_0xe48c('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2f2c7f){return function(_0x4580ac,_0x1bf632,_0x2bee34){FaxQueueEvents[_0xe48c('0x4')](_0x2f2c7f+':'+_0x4580ac['id'],_0x4580ac);FaxQueueEvents[_0xe48c('0x4')](_0x2f2c7f,_0x4580ac);_0x2bee34(null);};}for(var e in events){if(events[_0xe48c('0x5')](e)){var event=events[e];FaxQueue[_0xe48c('0x6')](e,emitEvent(event));}}module[_0xe48c('0x7')]=FaxQueueEvents;