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 _0x4c95=['remove','emit','hook','exports','events','OpenchannelMessage','setMaxListeners','save','update'];(function(_0x21d984,_0xe505d7){var _0x3edf58=function(_0x3dce16){while(--_0x3dce16){_0x21d984['push'](_0x21d984['shift']());}};_0x3edf58(++_0xe505d7);}(_0x4c95,0xdc));var _0x54c9=function(_0x343d86,_0x3c3adb){_0x343d86=_0x343d86-0x0;var _0x3e34a9=_0x4c95[_0x343d86];return _0x3e34a9;};'use strict';var EventEmitter=require(_0x54c9('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x54c9('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x54c9('0x2')](0x0);var events={'afterCreate':_0x54c9('0x3'),'afterUpdate':_0x54c9('0x4'),'afterDestroy':_0x54c9('0x5')};function emitEvent(_0x5ec107){return function(_0x10926d,_0x470e7f,_0x41b350){OpenchannelMessageEvents[_0x54c9('0x6')](_0x5ec107+':'+_0x10926d['id'],_0x10926d);OpenchannelMessageEvents[_0x54c9('0x6')](_0x5ec107,_0x10926d);_0x41b350(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0x54c9('0x7')](e,emitEvent(event));}}module[_0x54c9('0x8')]=OpenchannelMessageEvents;