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 _0x1a8f=['events','ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x58c7b0,_0x4cb178){var _0x22a17d=function(_0xdb4bc){while(--_0xdb4bc){_0x58c7b0['push'](_0x58c7b0['shift']());}};_0x22a17d(++_0x4cb178);}(_0x1a8f,0x87));var _0xf1a8=function(_0x79324e,_0x4af67e){_0x79324e=_0x79324e-0x0;var _0x555666=_0x1a8f[_0x79324e];return _0x555666;};'use strict';var EventEmitter=require(_0xf1a8('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0xf1a8('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xf1a8('0x2')](0x0);var events={'afterCreate':_0xf1a8('0x3'),'afterUpdate':_0xf1a8('0x4'),'afterDestroy':_0xf1a8('0x5')};function emitEvent(_0x5bc9ff){return function(_0x520d7d,_0x4f9445,_0x5712f0){ChatInternalMessageEvents[_0xf1a8('0x6')](_0x5bc9ff+':'+_0x520d7d['id'],_0x520d7d);ChatInternalMessageEvents[_0xf1a8('0x6')](_0x5bc9ff,_0x520d7d);_0x5712f0(null);};}for(var e in events){if(events[_0xf1a8('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xf1a8('0x8')]=ChatInternalMessageEvents;