Built motion from commit (unavailable).|2.5.26
[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 _0x4add=['events','../../mysqldb','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x4add,0x148));var _0xd4ad=function(_0x2577b5,_0xfd79a0){_0x2577b5=_0x2577b5-0x0;var _0x407298=_0x4add[_0x2577b5];return _0x407298;};'use strict';var EventEmitter=require(_0xd4ad('0x0'));var CmContact=require(_0xd4ad('0x1'))['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd4ad('0x2'),'afterUpdate':_0xd4ad('0x3'),'afterDestroy':_0xd4ad('0x4')};function emitEvent(_0x335ccf){return function(_0x3c6e97,_0x2b8360,_0x21f087){CmContactEvents[_0xd4ad('0x5')](_0x335ccf+':'+_0x3c6e97['id'],_0x3c6e97);CmContactEvents['emit'](_0x335ccf,_0x3c6e97);_0x21f087(null);};}for(var e in events){if(events[_0xd4ad('0x6')](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module[_0xd4ad('0x7')]=CmContactEvents;