Built motion from commit (unavailable).|2.5.6
[motion2.git] / server / api / cmContact / cmContact.events.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
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.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x2971=['emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x414af5,_0x1c5e8c){var _0x30ebf3=function(_0x18c7ef){while(--_0x18c7ef){_0x414af5['push'](_0x414af5['shift']());}};_0x30ebf3(++_0x1c5e8c);}(_0x2971,0x159));var _0x1297=function(_0x1eb903,_0xe2156a){_0x1eb903=_0x1eb903-0x0;var _0x3a1543=_0x2971[_0x1eb903];return _0x3a1543;};'use strict';var EventEmitter=require(_0x1297('0x0'));var CmContact=require(_0x1297('0x1'))['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents[_0x1297('0x2')](0x0);var events={'afterCreate':_0x1297('0x3'),'afterUpdate':_0x1297('0x4'),'afterDestroy':_0x1297('0x5')};function emitEvent(_0x3f5eba){return function(_0x51c909,_0x3d1618,_0x354534){CmContactEvents[_0x1297('0x6')](_0x3f5eba+':'+_0x51c909['id'],_0x51c909);CmContactEvents[_0x1297('0x6')](_0x3f5eba,_0x51c909);_0x354534(null);};}for(var e in events){if(events[_0x1297('0x7')](e)){var event=events[e];CmContact[_0x1297('0x8')](e,emitEvent(event));}}module['exports']=CmContactEvents;