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 _0xf349=['hook','exports','../../mysqldb','OpenchannelMessage','update','remove','emit','hasOwnProperty'];(function(_0x3dc538,_0x4f7702){var _0x72c2fd=function(_0x5a7260){while(--_0x5a7260){_0x3dc538['push'](_0x3dc538['shift']());}};_0x72c2fd(++_0x4f7702);}(_0xf349,0x1c2));var _0x9f34=function(_0x28725b,_0x5f270a){_0x28725b=_0x28725b-0x0;var _0xc6c07c=_0xf349[_0x28725b];return _0xc6c07c;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x9f34('0x0'))['db'][_0x9f34('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x9f34('0x2'),'afterDestroy':_0x9f34('0x3')};function emitEvent(_0x5ca2e6){return function(_0x500c21,_0x7f479d,_0x493956){OpenchannelMessageEvents[_0x9f34('0x4')](_0x5ca2e6+':'+_0x500c21['id'],_0x500c21);OpenchannelMessageEvents['emit'](_0x5ca2e6,_0x500c21);_0x493956(null);};}for(var e in events){if(events[_0x9f34('0x5')](e)){var event=events[e];OpenchannelMessage[_0x9f34('0x6')](e,emitEvent(event));}}module[_0x9f34('0x7')]=OpenchannelMessageEvents;