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 _0xc283=['remove','emit','hasOwnProperty','hook','exports','events','WhatsappQueue'];(function(_0xa9808c,_0x45c44b){var _0x2031b3=function(_0x4187e0){while(--_0x4187e0){_0xa9808c['push'](_0xa9808c['shift']());}};_0x2031b3(++_0x45c44b);}(_0xc283,0x194));var _0x3c28=function(_0x454f40,_0x4305f4){_0x454f40=_0x454f40-0x0;var _0x563088=_0xc283[_0x454f40];return _0x563088;};'use strict';var EventEmitter=require(_0x3c28('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0x3c28('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x3c28('0x2')};function emitEvent(_0x529507){return function(_0x46cec0,_0x219e63,_0x3611e6){WhatsappQueueEvents[_0x3c28('0x3')](_0x529507+':'+_0x46cec0['id'],_0x46cec0);WhatsappQueueEvents[_0x3c28('0x3')](_0x529507,_0x46cec0);_0x3611e6(null);};}for(var e in events){if(events[_0x3c28('0x4')](e)){var event=events[e];WhatsappQueue[_0x3c28('0x5')](e,emitEvent(event));}}module[_0x3c28('0x6')]=WhatsappQueueEvents;