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 _0xc436=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','update','emit'];(function(_0x149ca0,_0x2ac7f5){var _0x56b6b9=function(_0x486ac3){while(--_0x486ac3){_0x149ca0['push'](_0x149ca0['shift']());}};_0x56b6b9(++_0x2ac7f5);}(_0xc436,0x153));var _0x6c43=function(_0x4b0297,_0x27af79){_0x4b0297=_0x4b0297-0x0;var _0x179539=_0xc436[_0x4b0297];return _0x179539;};'use strict';var EventEmitter=require(_0x6c43('0x0'));var WhatsappAccount=require(_0x6c43('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x6c43('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6c43('0x3'),'afterDestroy':'remove'};function emitEvent(_0x37ee0e){return function(_0x35d95d,_0x2f479f,_0x23d795){WhatsappAccountEvents[_0x6c43('0x4')](_0x37ee0e+':'+_0x35d95d['id'],_0x35d95d);WhatsappAccountEvents[_0x6c43('0x4')](_0x37ee0e,_0x35d95d);_0x23d795(null);};}for(var e in events){if(events[_0x6c43('0x5')](e)){var event=events[e];WhatsappAccount[_0x6c43('0x6')](e,emitEvent(event));}}module[_0x6c43('0x7')]=WhatsappAccountEvents;