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 _0x6ec2=['events','../../mysqldb','WhatsappAccount','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x481aa2,_0x22c438){var _0xdc93e2=function(_0x202744){while(--_0x202744){_0x481aa2['push'](_0x481aa2['shift']());}};_0xdc93e2(++_0x22c438);}(_0x6ec2,0x78));var _0x26ec=function(_0x131c4b,_0x5dff4c){_0x131c4b=_0x131c4b-0x0;var _0x28eac7=_0x6ec2[_0x131c4b];return _0x28eac7;};'use strict';var EventEmitter=require(_0x26ec('0x0'));var WhatsappAccount=require(_0x26ec('0x1'))['db'][_0x26ec('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x26ec('0x3')](0x0);var events={'afterCreate':_0x26ec('0x4'),'afterUpdate':_0x26ec('0x5'),'afterDestroy':'remove'};function emitEvent(_0x336098){return function(_0x18650a,_0x2b4225,_0x13f29c){WhatsappAccountEvents[_0x26ec('0x6')](_0x336098+':'+_0x18650a['id'],_0x18650a);WhatsappAccountEvents['emit'](_0x336098,_0x18650a);_0x13f29c(null);};}for(var e in events){if(events[_0x26ec('0x7')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents;