1 // *************************************************************************
3 // * xCALLY Motion - The Omnichannel Contact Center *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved *
6 // *************************************************************************
8 // * Email: info@xcally.com *
9 // * Website: https://www.xcally.com *
11 // *************************************************************************
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. *
17 // *************************************************************************
18 var _0xc2c7=['update','remove','emit','hasOwnProperty','../../mysqldb','WhatsappAccount','setMaxListeners','save'];(function(_0x57ddfd,_0x52a33b){var _0xc5d9f3=function(_0x3368d3){while(--_0x3368d3){_0x57ddfd['push'](_0x57ddfd['shift']());}};_0xc5d9f3(++_0x52a33b);}(_0xc2c7,0x134));var _0x7c2c=function(_0x158e07,_0x33726b){_0x158e07=_0x158e07-0x0;var _0x405962=_0xc2c7[_0x158e07];return _0x405962;};'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;