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 _0x4cc5=['../../mysqldb','OpenchannelMessage','setMaxListeners','update','remove','hook','exports','events'];(function(_0x3d5ea8,_0x178208){var _0x540af1=function(_0x4f594c){while(--_0x4f594c){_0x3d5ea8['push'](_0x3d5ea8['shift']());}};_0x540af1(++_0x178208);}(_0x4cc5,0xb7));var _0x54cc=function(_0x4450c3,_0x38bf4e){_0x4450c3=_0x4450c3-0x0;var _0x49d621=_0x4cc5[_0x4450c3];return _0x49d621;};'use strict';var EventEmitter=require(_0x54cc('0x0'));var OpenchannelMessage=require(_0x54cc('0x1'))['db'][_0x54cc('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x54cc('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x54cc('0x4'),'afterDestroy':_0x54cc('0x5')};function emitEvent(_0x3147f3){return function(_0x2f2b50,_0x177e2e,_0x6c4324){OpenchannelMessageEvents['emit'](_0x3147f3+':'+_0x2f2b50['id'],_0x2f2b50);OpenchannelMessageEvents['emit'](_0x3147f3,_0x2f2b50);_0x6c4324(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0x54cc('0x6')](e,emitEvent(event));}}module[_0x54cc('0x7')]=OpenchannelMessageEvents;