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 _0x1e51=['../../mysqldb','CmContact','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x4ffa64,_0x271035){var _0x5da001=function(_0x7d1940){while(--_0x7d1940){_0x4ffa64['push'](_0x4ffa64['shift']());}};_0x5da001(++_0x271035);}(_0x1e51,0x155));var _0x11e5=function(_0x241af8,_0x11b22f){_0x241af8=_0x241af8-0x0;var _0x305002=_0x1e51[_0x241af8];return _0x305002;};'use strict';var EventEmitter=require(_0x11e5('0x0'));var CmContact=require(_0x11e5('0x1'))['db'][_0x11e5('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x11e5('0x3'),'afterUpdate':_0x11e5('0x4'),'afterDestroy':'remove'};function emitEvent(_0x27dcc5){return function(_0x1a7e58,_0x413979,_0x37bd86){CmContactEvents['emit'](_0x27dcc5+':'+_0x1a7e58['id'],_0x1a7e58);CmContactEvents[_0x11e5('0x5')](_0x27dcc5,_0x1a7e58);_0x37bd86(null);};}for(var e in events){if(events[_0x11e5('0x6')](e)){var event=events[e];CmContact[_0x11e5('0x7')](e,emitEvent(event));}}module[_0x11e5('0x8')]=CmContactEvents;