Built motion from commit (unavailable).|2.5.22
[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 _0x476c=['emit','hasOwnProperty','exports','events','../../mysqldb','CmContact','setMaxListeners','save','update'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x476c,0x159));var _0xc476=function(_0x33147a,_0x38c4e0){_0x33147a=_0x33147a-0x0;var _0x48709a=_0x476c[_0x33147a];return _0x48709a;};'use strict';var EventEmitter=require(_0xc476('0x0'));var CmContact=require(_0xc476('0x1'))['db'][_0xc476('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0xc476('0x3')](0x0);var events={'afterCreate':_0xc476('0x4'),'afterUpdate':_0xc476('0x5'),'afterDestroy':'remove'};function emitEvent(_0xc45e8d){return function(_0x10eb0e,_0x490009,_0x44eea7){CmContactEvents[_0xc476('0x6')](_0xc45e8d+':'+_0x10eb0e['id'],_0x10eb0e);CmContactEvents['emit'](_0xc45e8d,_0x10eb0e);_0x44eea7(null);};}for(var e in events){if(events[_0xc476('0x7')](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module[_0xc476('0x8')]=CmContactEvents;