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 _0x7ee4=['../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x11ff6a,_0x59c826){var _0x23989a=function(_0x4843cf){while(--_0x4843cf){_0x11ff6a['push'](_0x11ff6a['shift']());}};_0x23989a(++_0x59c826);}(_0x7ee4,0x1c7));var _0x47ee=function(_0x314ccb,_0x38886e){_0x314ccb=_0x314ccb-0x0;var _0x257b48=_0x7ee4[_0x314ccb];return _0x257b48;};'use strict';var EventEmitter=require(_0x47ee('0x0'));var WhatsappQueue=require(_0x47ee('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x47ee('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x47ee('0x3'),'afterDestroy':_0x47ee('0x4')};function emitEvent(_0xabbaf4){return function(_0x190850,_0x2c6d6c,_0x15f7be){WhatsappQueueEvents[_0x47ee('0x5')](_0xabbaf4+':'+_0x190850['id'],_0x190850);WhatsappQueueEvents['emit'](_0xabbaf4,_0x190850);_0x15f7be(null);};}for(var e in events){if(events[_0x47ee('0x6')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0x47ee('0x7')]=WhatsappQueueEvents;