1 // *************************************************************************
3 // * xCALLY Motion - The Omnichannel Contact Center *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved *
6 // *************************************************************************
8 // * Email: info@xcally.com *
9 // * Website: https://www.xcally.com *
11 // *************************************************************************
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. *
17 // *************************************************************************
18 var _0x43aa=['emit','hasOwnProperty','exports','events','setMaxListeners','save','update'];(function(_0x42f3e4,_0x2646fd){var _0x1d7aa6=function(_0x4a721d){while(--_0x4a721d){_0x42f3e4['push'](_0x42f3e4['shift']());}};_0x1d7aa6(++_0x2646fd);}(_0x43aa,0xc0));var _0xa43a=function(_0x33cc3f,_0x1661f1){_0x33cc3f=_0x33cc3f-0x0;var _0x4fdc9c=_0x43aa[_0x33cc3f];return _0x4fdc9c;};'use strict';var EventEmitter=require(_0xa43a('0x0'));var FaxQueue=require('../../mysqldb')['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xa43a('0x1')](0x0);var events={'afterCreate':_0xa43a('0x2'),'afterUpdate':_0xa43a('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2edfb3){return function(_0x5ca8dd,_0x1afdeb,_0x1fc4a7){FaxQueueEvents['emit'](_0x2edfb3+':'+_0x5ca8dd['id'],_0x5ca8dd);FaxQueueEvents[_0xa43a('0x4')](_0x2edfb3,_0x5ca8dd);_0x1fc4a7(null);};}for(var e in events){if(events[_0xa43a('0x5')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0xa43a('0x6')]=FaxQueueEvents;