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 _0x03d0=['exports','events','WhatsappQueue','setMaxListeners','save','emit','hook'];(function(_0x250244,_0x3b6469){var _0x3d5a98=function(_0x74b3b8){while(--_0x74b3b8){_0x250244['push'](_0x250244['shift']());}};_0x3d5a98(++_0x3b6469);}(_0x03d0,0x8d));var _0x003d=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x03d0[_0x4154a6];return _0x3b2786;};'use strict';var EventEmitter=require(_0x003d('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0x003d('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x003d('0x2')](0x0);var events={'afterCreate':_0x003d('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1fc40e){return function(_0x559c24,_0x41a95e,_0x48db12){WhatsappQueueEvents[_0x003d('0x4')](_0x1fc40e+':'+_0x559c24['id'],_0x559c24);WhatsappQueueEvents[_0x003d('0x4')](_0x1fc40e,_0x559c24);_0x48db12(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x003d('0x5')](e,emitEvent(event));}}module[_0x003d('0x6')]=WhatsappQueueEvents;