Built motion from commit da617fac.|2.6.6
[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 _0xaf25=['remove','emit','hasOwnProperty','hook','exports','WhatsappAccount','setMaxListeners','save','update'];(function(_0x5bc343,_0x4c7403){var _0x4c313d=function(_0x1534e7){while(--_0x1534e7){_0x5bc343['push'](_0x5bc343['shift']());}};_0x4c313d(++_0x4c7403);}(_0xaf25,0x95));var _0x5af2=function(_0x309b0b,_0x53467b){_0x309b0b=_0x309b0b-0x0;var _0x4ffd2c=_0xaf25[_0x309b0b];return _0x4ffd2c;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require('../../mysqldb')['db'][_0x5af2('0x0')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x5af2('0x1')](0x0);var events={'afterCreate':_0x5af2('0x2'),'afterUpdate':_0x5af2('0x3'),'afterDestroy':_0x5af2('0x4')};function emitEvent(_0x43f14d){return function(_0x516526,_0x552d47,_0x127cf8){WhatsappAccountEvents[_0x5af2('0x5')](_0x43f14d+':'+_0x516526['id'],_0x516526);WhatsappAccountEvents['emit'](_0x43f14d,_0x516526);_0x127cf8(null);};}for(var e in events){if(events[_0x5af2('0x6')](e)){var event=events[e];WhatsappAccount[_0x5af2('0x7')](e,emitEvent(event));}}module[_0x5af2('0x8')]=WhatsappAccountEvents;