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 _0x0c5d=['remove','emit','hook','events','../../mysqldb','setMaxListeners','update'];(function(_0xdc6b54,_0x5d78fd){var _0x449e79=function(_0x7f08a0){while(--_0x7f08a0){_0xdc6b54['push'](_0xdc6b54['shift']());}};_0x449e79(++_0x5d78fd);}(_0x0c5d,0x6c));var _0xd0c5=function(_0x12c119,_0x3306a3){_0x12c119=_0x12c119-0x0;var _0x41595a=_0x0c5d[_0x12c119];return _0x41595a;};'use strict';var EventEmitter=require(_0xd0c5('0x0'));var WhatsappMessage=require(_0xd0c5('0x1'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xd0c5('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd0c5('0x3'),'afterDestroy':_0xd0c5('0x4')};function emitEvent(_0x83f28){return function(_0x177811,_0x4664bc,_0xc3a9b9){WhatsappMessageEvents[_0xd0c5('0x5')](_0x83f28+':'+_0x177811['id'],_0x177811);WhatsappMessageEvents[_0xd0c5('0x5')](_0x83f28,_0x177811);_0xc3a9b9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage[_0xd0c5('0x6')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents;