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 _0xf776=['exports','events','ChatInternalMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x23e859,_0x419ccc){var _0xe4964=function(_0x2e2501){while(--_0x2e2501){_0x23e859['push'](_0x23e859['shift']());}};_0xe4964(++_0x419ccc);}(_0xf776,0x169));var _0x6f77=function(_0x471bd9,_0x144273){_0x471bd9=_0x471bd9-0x0;var _0x265a2c=_0xf776[_0x471bd9];return _0x265a2c;};'use strict';var EventEmitter=require(_0x6f77('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x6f77('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x6f77('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6f77('0x3'),'afterDestroy':_0x6f77('0x4')};function emitEvent(_0x3897be){return function(_0x16874b,_0x53ec9b,_0xf025ec){ChatInternalMessageEvents['emit'](_0x3897be+':'+_0x16874b['id'],_0x16874b);ChatInternalMessageEvents[_0x6f77('0x5')](_0x3897be,_0x16874b);_0xf025ec(null);};}for(var e in events){if(events[_0x6f77('0x6')](e)){var event=events[e];ChatInternalMessage[_0x6f77('0x7')](e,emitEvent(event));}}module[_0x6f77('0x8')]=ChatInternalMessageEvents;