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 _0x4c02=['emit','hasOwnProperty','hook','events','../../mysqldb','ChatInternalMessage','save','update','remove'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x4c02,0x147));var _0x24c0=function(_0x1ee5be,_0x5f46e3){_0x1ee5be=_0x1ee5be-0x0;var _0x177140=_0x4c02[_0x1ee5be];return _0x177140;};'use strict';var EventEmitter=require(_0x24c0('0x0'));var ChatInternalMessage=require(_0x24c0('0x1'))['db'][_0x24c0('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x24c0('0x3'),'afterUpdate':_0x24c0('0x4'),'afterDestroy':_0x24c0('0x5')};function emitEvent(_0x5e7859){return function(_0x5029df,_0x461ad6,_0x166925){ChatInternalMessageEvents[_0x24c0('0x6')](_0x5e7859+':'+_0x5029df['id'],_0x5029df);ChatInternalMessageEvents[_0x24c0('0x6')](_0x5e7859,_0x5029df);_0x166925(null);};}for(var e in events){if(events[_0x24c0('0x7')](e)){var event=events[e];ChatInternalMessage[_0x24c0('0x8')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;