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 _0x7f4a=['hook','exports','events','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0x7f4a,0x18e));var _0xa7f4=function(_0x41273c,_0x4c0c04){_0x41273c=_0x41273c-0x0;var _0x453ce4=_0x7f4a[_0x41273c];return _0x453ce4;};'use strict';var EventEmitter=require(_0xa7f4('0x0'));var WhatsappQueue=require(_0xa7f4('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xa7f4('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa7f4('0x3'),'afterDestroy':_0xa7f4('0x4')};function emitEvent(_0x4278da){return function(_0x8521ba,_0x5a5d18,_0x2e3201){WhatsappQueueEvents[_0xa7f4('0x5')](_0x4278da+':'+_0x8521ba['id'],_0x8521ba);WhatsappQueueEvents[_0xa7f4('0x5')](_0x4278da,_0x8521ba);_0x2e3201(null);};}for(var e in events){if(events[_0xa7f4('0x6')](e)){var event=events[e];WhatsappQueue[_0xa7f4('0x7')](e,emitEvent(event));}}module[_0xa7f4('0x8')]=WhatsappQueueEvents;