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 _0x8fda=['save','update','remove','emit','hasOwnProperty','hook','../../mysqldb','WhatsappAccount','setMaxListeners'];(function(_0x3e7bf3,_0x3839cc){var _0xad4708=function(_0x1558d7){while(--_0x1558d7){_0x3e7bf3['push'](_0x3e7bf3['shift']());}};_0xad4708(++_0x3839cc);}(_0x8fda,0x7b));var _0xa8fd=function(_0x2427bc,_0x4c016d){_0x2427bc=_0x2427bc-0x0;var _0x21d800=_0x8fda[_0x2427bc];return _0x21d800;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0xa8fd('0x0'))['db'][_0xa8fd('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xa8fd('0x2')](0x0);var events={'afterCreate':_0xa8fd('0x3'),'afterUpdate':_0xa8fd('0x4'),'afterDestroy':_0xa8fd('0x5')};function emitEvent(_0x5936fa){return function(_0x35e693,_0x598353,_0x42d068){WhatsappAccountEvents[_0xa8fd('0x6')](_0x5936fa+':'+_0x35e693['id'],_0x35e693);WhatsappAccountEvents[_0xa8fd('0x6')](_0x5936fa,_0x35e693);_0x42d068(null);};}for(var e in events){if(events[_0xa8fd('0x7')](e)){var event=events[e];WhatsappAccount[_0xa8fd('0x8')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents;