Built motion from commit 3c2ce842.|2.6.31
[motion2.git] / server / api / openchannelAccount / openchannelAccount.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 _0x6c76=['update','emit','hook','events','../../mysqldb','OpenchannelAccount','save'];(function(_0x5c2cea,_0x397c29){var _0x26054e=function(_0x494dcf){while(--_0x494dcf){_0x5c2cea['push'](_0x5c2cea['shift']());}};_0x26054e(++_0x397c29);}(_0x6c76,0x184));var _0x66c7=function(_0x46a2f1,_0x321d0b){_0x46a2f1=_0x46a2f1-0x0;var _0x3c18f4=_0x6c76[_0x46a2f1];return _0x3c18f4;};'use strict';var EventEmitter=require(_0x66c7('0x0'));var OpenchannelAccount=require(_0x66c7('0x1'))['db'][_0x66c7('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x66c7('0x3'),'afterUpdate':_0x66c7('0x4'),'afterDestroy':'remove'};function emitEvent(_0x572a2b){return function(_0x2f6db7,_0x2b7cf3,_0x49d437){OpenchannelAccountEvents[_0x66c7('0x5')](_0x572a2b+':'+_0x2f6db7['id'],_0x2f6db7);OpenchannelAccountEvents[_0x66c7('0x5')](_0x572a2b,_0x2f6db7);_0x49d437(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x66c7('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents;