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 _0xccf8=['WhatsappAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x4fad1d,_0x52ed56){var _0x45b2d4=function(_0x258b6f){while(--_0x258b6f){_0x4fad1d['push'](_0x4fad1d['shift']());}};_0x45b2d4(++_0x52ed56);}(_0xccf8,0xf0));var _0x8ccf=function(_0x18df7c,_0x1c3441){_0x18df7c=_0x18df7c-0x0;var _0x15c4e1=_0xccf8[_0x18df7c];return _0x15c4e1;};'use strict';var EventEmitter=require(_0x8ccf('0x0'));var WhatsappAccount=require(_0x8ccf('0x1'))['db'][_0x8ccf('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x8ccf('0x3')](0x0);var events={'afterCreate':_0x8ccf('0x4'),'afterUpdate':_0x8ccf('0x5'),'afterDestroy':_0x8ccf('0x6')};function emitEvent(_0x1bef69){return function(_0x931847,_0x5c5044,_0xa28230){WhatsappAccountEvents[_0x8ccf('0x7')](_0x1bef69+':'+_0x931847['id'],_0x931847);WhatsappAccountEvents[_0x8ccf('0x7')](_0x1bef69,_0x931847);_0xa28230(null);};}for(var e in events){if(events[_0x8ccf('0x8')](e)){var event=events[e];WhatsappAccount[_0x8ccf('0x9')](e,emitEvent(event));}}module[_0x8ccf('0xa')]=WhatsappAccountEvents;