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 _0x8e12=['events','../../mysqldb','WhatsappQueue','setMaxListeners','remove','emit','hasOwnProperty','hook'];(function(_0x10a678,_0x6d2e62){var _0xe7206f=function(_0x2030a1){while(--_0x2030a1){_0x10a678['push'](_0x10a678['shift']());}};_0xe7206f(++_0x6d2e62);}(_0x8e12,0x130));var _0x28e1=function(_0x1b1834,_0x165b05){_0x1b1834=_0x1b1834-0x0;var _0x5352ad=_0x8e12[_0x1b1834];return _0x5352ad;};'use strict';var EventEmitter=require(_0x28e1('0x0'));var WhatsappQueue=require(_0x28e1('0x1'))['db'][_0x28e1('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x28e1('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x28e1('0x4')};function emitEvent(_0x27866d){return function(_0x5d4f38,_0xa32bb2,_0x4d9174){WhatsappQueueEvents[_0x28e1('0x5')](_0x27866d+':'+_0x5d4f38['id'],_0x5d4f38);WhatsappQueueEvents[_0x28e1('0x5')](_0x27866d,_0x5d4f38);_0x4d9174(null);};}for(var e in events){if(events[_0x28e1('0x6')](e)){var event=events[e];WhatsappQueue[_0x28e1('0x7')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents;