Built motion from commit 71df090e.|2.6.31
[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 _0x9b97=['remove','emit','hasOwnProperty','exports','../../mysqldb','WhatsappAccount','save','update'];(function(_0x268e19,_0x49b4ad){var _0x87ac2b=function(_0x244836){while(--_0x244836){_0x268e19['push'](_0x268e19['shift']());}};_0x87ac2b(++_0x49b4ad);}(_0x9b97,0x154));var _0x79b9=function(_0x274ad0,_0x739484){_0x274ad0=_0x274ad0-0x0;var _0x688a57=_0x9b97[_0x274ad0];return _0x688a57;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0x79b9('0x0'))['db'][_0x79b9('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x79b9('0x2'),'afterUpdate':_0x79b9('0x3'),'afterDestroy':_0x79b9('0x4')};function emitEvent(_0x3e4af1){return function(_0x259e3c,_0x3bed33,_0x3393b8){WhatsappAccountEvents[_0x79b9('0x5')](_0x3e4af1+':'+_0x259e3c['id'],_0x259e3c);WhatsappAccountEvents[_0x79b9('0x5')](_0x3e4af1,_0x259e3c);_0x3393b8(null);};}for(var e in events){if(events[_0x79b9('0x6')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0x79b9('0x7')]=WhatsappAccountEvents;