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 _0x7b7b=['WhatsappQueue','setMaxListeners','save','update','remove','hasOwnProperty','events','../../mysqldb'];(function(_0x5b76f1,_0x149656){var _0x3907f5=function(_0x235725){while(--_0x235725){_0x5b76f1['push'](_0x5b76f1['shift']());}};_0x3907f5(++_0x149656);}(_0x7b7b,0x12e));var _0xb7b7=function(_0x56b034,_0xb96f9b){_0x56b034=_0x56b034-0x0;var _0x25f338=_0x7b7b[_0x56b034];return _0x25f338;};'use strict';var EventEmitter=require(_0xb7b7('0x0'));var WhatsappQueue=require(_0xb7b7('0x1'))['db'][_0xb7b7('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xb7b7('0x3')](0x0);var events={'afterCreate':_0xb7b7('0x4'),'afterUpdate':_0xb7b7('0x5'),'afterDestroy':_0xb7b7('0x6')};function emitEvent(_0x53b87c){return function(_0x24958b,_0x59ebe5,_0x5a61fd){WhatsappQueueEvents['emit'](_0x53b87c+':'+_0x24958b['id'],_0x24958b);WhatsappQueueEvents['emit'](_0x53b87c,_0x24958b);_0x5a61fd(null);};}for(var e in events){if(events[_0xb7b7('0x7')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents;