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 _0x8fcd=['events','../../mysqldb','FaxMessage','setMaxListeners','save','emit','exports'];(function(_0x511bd1,_0x223e5b){var _0x4c48ec=function(_0x31814e){while(--_0x31814e){_0x511bd1['push'](_0x511bd1['shift']());}};_0x4c48ec(++_0x223e5b);}(_0x8fcd,0xa1));var _0xd8fc=function(_0x34321f,_0x8cf48b){_0x34321f=_0x34321f-0x0;var _0x43b7e2=_0x8fcd[_0x34321f];return _0x43b7e2;};'use strict';var EventEmitter=require(_0xd8fc('0x0'));var FaxMessage=require(_0xd8fc('0x1'))['db'][_0xd8fc('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xd8fc('0x3')](0x0);var events={'afterCreate':_0xd8fc('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x353592){return function(_0x36d5ad,_0x41aaf1,_0x2d5000){FaxMessageEvents[_0xd8fc('0x5')](_0x353592+':'+_0x36d5ad['id'],_0x36d5ad);FaxMessageEvents[_0xd8fc('0x5')](_0x353592,_0x36d5ad);_0x2d5000(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0xd8fc('0x6')]=FaxMessageEvents;