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 _0x3fc4=['OpenchannelMessage','remove','emit','hasOwnProperty','exports'];(function(_0x28e2cd,_0x153b42){var _0x11fd46=function(_0x50df13){while(--_0x50df13){_0x28e2cd['push'](_0x28e2cd['shift']());}};_0x11fd46(++_0x153b42);}(_0x3fc4,0x69));var _0x43fc=function(_0x3457c0,_0x2b4b7f){_0x3457c0=_0x3457c0-0x0;var _0x33c23d=_0x3fc4[_0x3457c0];return _0x33c23d;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require('../../mysqldb')['db'][_0x43fc('0x0')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x43fc('0x1')};function emitEvent(_0x46ebbc){return function(_0x54729b,_0x183f73,_0x655dae){OpenchannelMessageEvents[_0x43fc('0x2')](_0x46ebbc+':'+_0x54729b['id'],_0x54729b);OpenchannelMessageEvents[_0x43fc('0x2')](_0x46ebbc,_0x54729b);_0x655dae(null);};}for(var e in events){if(events[_0x43fc('0x3')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x43fc('0x4')]=OpenchannelMessageEvents;