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 _0xfc9d=['setMaxListeners','update','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x3e021c,_0x10e5be){var _0x5445ed=function(_0x84280d){while(--_0x84280d){_0x3e021c['push'](_0x3e021c['shift']());}};_0x5445ed(++_0x10e5be);}(_0xfc9d,0x194));var _0xdfc9=function(_0x4e11fc,_0x2602e){_0x4e11fc=_0x4e11fc-0x0;var _0x398c4f=_0xfc9d[_0x4e11fc];return _0x398c4f;};'use strict';var EventEmitter=require(_0xdfc9('0x0'));var WhatsappAccount=require(_0xdfc9('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xdfc9('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdfc9('0x3'),'afterDestroy':_0xdfc9('0x4')};function emitEvent(_0x3962cf){return function(_0x168132,_0x4fba6d,_0x4e0e35){WhatsappAccountEvents[_0xdfc9('0x5')](_0x3962cf+':'+_0x168132['id'],_0x168132);WhatsappAccountEvents[_0xdfc9('0x5')](_0x3962cf,_0x168132);_0x4e0e35(null);};}for(var e in events){if(events[_0xdfc9('0x6')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents;