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 _0xdf71=['setMaxListeners','save','update','remove','emit','hook','exports','events','ChatInternalMessage'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xdf71,0x1d2));var _0x1df7=function(_0x2a2f51,_0x2c76cf){_0x2a2f51=_0x2a2f51-0x0;var _0x53d7c4=_0xdf71[_0x2a2f51];return _0x53d7c4;};'use strict';var EventEmitter=require(_0x1df7('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x1df7('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x1df7('0x2')](0x0);var events={'afterCreate':_0x1df7('0x3'),'afterUpdate':_0x1df7('0x4'),'afterDestroy':_0x1df7('0x5')};function emitEvent(_0x43490d){return function(_0x436544,_0x570cbd,_0xc9e362){ChatInternalMessageEvents[_0x1df7('0x6')](_0x43490d+':'+_0x436544['id'],_0x436544);ChatInternalMessageEvents['emit'](_0x43490d,_0x436544);_0xc9e362(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x1df7('0x7')](e,emitEvent(event));}}module[_0x1df7('0x8')]=ChatInternalMessageEvents;