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 _0xbd0a=['emit','hasOwnProperty','hook','events','FaxMessage','remove'];(function(_0x26f082,_0xd7969a){var _0x4f8cec=function(_0x2d82ad){while(--_0x2d82ad){_0x26f082['push'](_0x26f082['shift']());}};_0x4f8cec(++_0xd7969a);}(_0xbd0a,0x1b9));var _0xabd0=function(_0x20c338,_0xebbbb6){_0x20c338=_0x20c338-0x0;var _0x4d4566=_0xbd0a[_0x20c338];return _0x4d4566;};'use strict';var EventEmitter=require(_0xabd0('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0xabd0('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xabd0('0x2')};function emitEvent(_0x38111b){return function(_0x41e52b,_0x3d1138,_0x1a4ff4){FaxMessageEvents[_0xabd0('0x3')](_0x38111b+':'+_0x41e52b['id'],_0x41e52b);FaxMessageEvents[_0xabd0('0x3')](_0x38111b,_0x41e52b);_0x1a4ff4(null);};}for(var e in events){if(events[_0xabd0('0x4')](e)){var event=events[e];FaxMessage[_0xabd0('0x5')](e,emitEvent(event));}}module['exports']=FaxMessageEvents;