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 _0x1c7c=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners'];(function(_0x7b8cae,_0xd3983f){var _0x46ae49=function(_0x3872f1){while(--_0x3872f1){_0x7b8cae['push'](_0x7b8cae['shift']());}};_0x46ae49(++_0xd3983f);}(_0x1c7c,0x164));var _0xc1c7=function(_0x2ebdc5,_0x323f93){_0x2ebdc5=_0x2ebdc5-0x0;var _0x10f41a=_0x1c7c[_0x2ebdc5];return _0x10f41a;};'use strict';var EventEmitter=require(_0xc1c7('0x0'));var WhatsappMessage=require(_0xc1c7('0x1'))['db'][_0xc1c7('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xc1c7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc1c7('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3cb551){return function(_0x20dad3,_0xbb9da0,_0x2a0383){WhatsappMessageEvents[_0xc1c7('0x5')](_0x3cb551+':'+_0x20dad3['id'],_0x20dad3);WhatsappMessageEvents[_0xc1c7('0x5')](_0x3cb551,_0x20dad3);_0x2a0383(null);};}for(var e in events){if(events[_0xc1c7('0x6')](e)){var event=events[e];WhatsappMessage[_0xc1c7('0x7')](e,emitEvent(event));}}module[_0xc1c7('0x8')]=WhatsappMessageEvents;