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 _0x45cc=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x45cc,0x181));var _0xc45c=function(_0x23cc76,_0x9c756b){_0x23cc76=_0x23cc76-0x0;var _0x2f5c13=_0x45cc[_0x23cc76];return _0x2f5c13;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0xc45c('0x0'))['db'][_0xc45c('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xc45c('0x2')](0x0);var events={'afterCreate':_0xc45c('0x3'),'afterUpdate':_0xc45c('0x4'),'afterDestroy':_0xc45c('0x5')};function emitEvent(_0x351c3d){return function(_0x42a028,_0x2cf57c,_0x4a2ced){OpenchannelMessageEvents['emit'](_0x351c3d+':'+_0x42a028['id'],_0x42a028);OpenchannelMessageEvents[_0xc45c('0x6')](_0x351c3d,_0x42a028);_0x4a2ced(null);};}for(var e in events){if(events[_0xc45c('0x7')](e)){var event=events[e];OpenchannelMessage[_0xc45c('0x8')](e,emitEvent(event));}}module[_0xc45c('0x9')]=OpenchannelMessageEvents;