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 _0x323f=['save','update','remove','emit','hook','exports','../../mysqldb','setMaxListeners'];(function(_0x4b040b,_0x5f3f0b){var _0x22c56c=function(_0xd807b4){while(--_0xd807b4){_0x4b040b['push'](_0x4b040b['shift']());}};_0x22c56c(++_0x5f3f0b);}(_0x323f,0x1ee));var _0xf323=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x323f[_0x484e36];return _0xafc85d;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0xf323('0x0'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xf323('0x1')](0x0);var events={'afterCreate':_0xf323('0x2'),'afterUpdate':_0xf323('0x3'),'afterDestroy':_0xf323('0x4')};function emitEvent(_0x111042){return function(_0x2c9d35,_0xb4caa8,_0x2d4750){WhatsappAccountEvents[_0xf323('0x5')](_0x111042+':'+_0x2c9d35['id'],_0x2c9d35);WhatsappAccountEvents[_0xf323('0x5')](_0x111042,_0x2c9d35);_0x2d4750(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0xf323('0x6')](e,emitEvent(event));}}module[_0xf323('0x7')]=WhatsappAccountEvents;