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 _0x735a=['events','../../mysqldb','save','remove','emit','hasOwnProperty','hook'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x735a,0x12d));var _0xa735=function(_0x8f2883,_0x33fbad){_0x8f2883=_0x8f2883-0x0;var _0x1d1410=_0x735a[_0x8f2883];return _0x1d1410;};'use strict';var EventEmitter=require(_0xa735('0x0'));var WhatsappQueue=require(_0xa735('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa735('0x2'),'afterUpdate':'update','afterDestroy':_0xa735('0x3')};function emitEvent(_0x3bb2c2){return function(_0xf3473,_0xc2ac5b,_0x333c5d){WhatsappQueueEvents['emit'](_0x3bb2c2+':'+_0xf3473['id'],_0xf3473);WhatsappQueueEvents[_0xa735('0x4')](_0x3bb2c2,_0xf3473);_0x333c5d(null);};}for(var e in events){if(events[_0xa735('0x5')](e)){var event=events[e];WhatsappQueue[_0xa735('0x6')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents;