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 _0x4f7b=['WhatsappMessage','setMaxListeners','update','remove','emit','hook','events','../../mysqldb'];(function(_0x4bd818,_0x37a525){var _0x5eda49=function(_0x5c128f){while(--_0x5c128f){_0x4bd818['push'](_0x4bd818['shift']());}};_0x5eda49(++_0x37a525);}(_0x4f7b,0x13e));var _0xb4f7=function(_0x1f45d3,_0x366f3f){_0x1f45d3=_0x1f45d3-0x0;var _0x16dd74=_0x4f7b[_0x1f45d3];return _0x16dd74;};'use strict';var EventEmitter=require(_0xb4f7('0x0'));var WhatsappMessage=require(_0xb4f7('0x1'))['db'][_0xb4f7('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xb4f7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb4f7('0x4'),'afterDestroy':_0xb4f7('0x5')};function emitEvent(_0x18a8f6){return function(_0x297970,_0x1d34b7,_0x37ef5a){WhatsappMessageEvents[_0xb4f7('0x6')](_0x18a8f6+':'+_0x297970['id'],_0x297970);WhatsappMessageEvents[_0xb4f7('0x6')](_0x18a8f6,_0x297970);_0x37ef5a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage[_0xb4f7('0x7')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents;