be81138877e554faed27fead1a3102a0c0a1ea89
[motion-next.git] / server / api / whatsappAccount / whatsappAccount.events.js
1 const a784_0x1f36=['../../mysqldb','events','emit','update','undefined','addHook','WhatsappAccount','save'];(function(_0x530158,_0x1f361a){const _0x261b36=function(_0xb83c53){while(--_0xb83c53){_0x530158['push'](_0x530158['shift']());}};_0x261b36(++_0x1f361a);}(a784_0x1f36,0x70));const a784_0x261b=function(_0x530158,_0x1f361a){_0x530158=_0x530158-0x0;let _0x261b36=a784_0x1f36[_0x530158];return _0x261b36;};const _0x2554b0=a784_0x261b;'use strict';const EventEmitter=require(_0x2554b0('0x1')),WhatsappAccount=require(_0x2554b0('0x0'))['db'][_0x2554b0('0x6')],WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);const events={'afterCreate':_0x2554b0('0x7'),'afterUpdate':_0x2554b0('0x3'),'afterDestroy':'remove'};function emitEvent(_0xb83c53){return function(_0x2321fd){const _0x203d2c=a784_0x261b;WhatsappAccountEvents['emit'](_0xb83c53+':'+_0x2321fd['id'],_0x2321fd),WhatsappAccountEvents[_0x203d2c('0x2')](_0xb83c53,_0x2321fd);};}for(const e in events){if(typeof events[e]!==_0x2554b0('0x4')){const event=events[e];WhatsappAccount[_0x2554b0('0x5')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents;