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 _0x6de8=['WhatsappQueue','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x55c23b,_0xa2e650){var _0x2a2071=function(_0x4f5dcb){while(--_0x4f5dcb){_0x55c23b['push'](_0x55c23b['shift']());}};_0x2a2071(++_0xa2e650);}(_0x6de8,0x141));var _0x86de=function(_0x266ddc,_0x45aa52){_0x266ddc=_0x266ddc-0x0;var _0x39c1d7=_0x6de8[_0x266ddc];return _0x39c1d7;};'use strict';var EventEmitter=require(_0x86de('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0x86de('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x86de('0x2'),'afterDestroy':'remove'};function emitEvent(_0x6fc4c3){return function(_0x453bd2,_0x2a240e,_0xc80a35){WhatsappQueueEvents[_0x86de('0x3')](_0x6fc4c3+':'+_0x453bd2['id'],_0x453bd2);WhatsappQueueEvents[_0x86de('0x3')](_0x6fc4c3,_0x453bd2);_0xc80a35(null);};}for(var e in events){if(events[_0x86de('0x4')](e)){var event=events[e];WhatsappQueue[_0x86de('0x5')](e,emitEvent(event));}}module[_0x86de('0x6')]=WhatsappQueueEvents;