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 _0x7c42=['setMaxListeners','update','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x28883f,_0x27474c){var _0x2ab339=function(_0x551bb4){while(--_0x551bb4){_0x28883f['push'](_0x28883f['shift']());}};_0x2ab339(++_0x27474c);}(_0x7c42,0x178));var _0x27c4=function(_0x1f4472,_0x2684d4){_0x1f4472=_0x1f4472-0x0;var _0x3ef0af=_0x7c42[_0x1f4472];return _0x3ef0af;};'use strict';var EventEmitter=require(_0x27c4('0x0'));var WhatsappQueue=require(_0x27c4('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x27c4('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x27c4('0x3'),'afterDestroy':_0x27c4('0x4')};function emitEvent(_0x1a417a){return function(_0x155867,_0x4664a6,_0xea39c2){WhatsappQueueEvents['emit'](_0x1a417a+':'+_0x155867['id'],_0x155867);WhatsappQueueEvents[_0x27c4('0x5')](_0x1a417a,_0x155867);_0xea39c2(null);};}for(var e in events){if(events[_0x27c4('0x6')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents;