Built motion from commit (unavailable).|2.5.4
[motion2.git] / server / api / whatsappAccount / whatsappAccount.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 _0xc2c7=['update','remove','emit','hasOwnProperty','../../mysqldb','WhatsappAccount','setMaxListeners','save'];(function(_0x764e20,_0x5df727){var _0x346355=function(_0xa36225){while(--_0xa36225){_0x764e20['push'](_0x764e20['shift']());}};_0x346355(++_0x5df727);}(_0xc2c7,0x134));var _0x7c2c=function(_0x4d1bb9,_0xb082f4){_0x4d1bb9=_0x4d1bb9-0x0;var _0x192fda=_0xc2c7[_0x4d1bb9];return _0x192fda;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0x7c2c('0x0'))['db'][_0x7c2c('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x7c2c('0x2')](0x0);var events={'afterCreate':_0x7c2c('0x3'),'afterUpdate':_0x7c2c('0x4'),'afterDestroy':_0x7c2c('0x5')};function emitEvent(_0x472eae){return function(_0x116f8a,_0x4bbc14,_0x59f346){WhatsappAccountEvents[_0x7c2c('0x6')](_0x472eae+':'+_0x116f8a['id'],_0x116f8a);WhatsappAccountEvents[_0x7c2c('0x6')](_0x472eae,_0x116f8a);_0x59f346(null);};}for(var e in events){if(events[_0x7c2c('0x7')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents;