Built motion from commit 0900f080.|2.5.45
[motion2.git] / server / api / whatsappInteraction / whatsappInteraction.events.js
index 3fada8f..f9bb9f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc125=['getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xc125,0x150));var _0x5c12=function(_0x5a6e78,_0x313048){_0x5a6e78=_0x5a6e78-0x0;var _0x189fce=_0xc125[_0x5a6e78];return _0x189fce;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0x5c12('0x0'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0x5c12('0x0'))['db'][_0x5c12('0x1')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x5c12('0x2')](0x0);var events={'afterCreate':_0x5c12('0x3'),'afterUpdate':_0x5c12('0x4'),'afterDestroy':_0x5c12('0x5')};function emitEvent(_0x31bd53){return function(_0x275ea3,_0x3aa4b7,_0x3f1c8b){_0x275ea3[_0x5c12('0x6')]({'attributes':['id'],'raw':!![]})[_0x5c12('0x7')](function(_0x4cab65){_0x275ea3[_0x5c12('0x8')](_0x5c12('0x9'),_0x4cab65['map'](function(_0x29342a){return{'id':_0x29342a['id']};}));return WhatsappMessage[_0x5c12('0xa')]({'where':{'WhatsappInteractionId':_0x275ea3['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5c12('0x7')](function(_0x33f493){_0x275ea3[_0x5c12('0x8')](_0x5c12('0xb'),_0x33f493[_0x5c12('0xc')]);WhatsappInteractionEvents[_0x5c12('0xd')](_0x31bd53+':'+_0x275ea3['id'],_0x275ea3);WhatsappInteractionEvents['emit'](_0x31bd53,_0x275ea3);_0x3f1c8b(null);})[_0x5c12('0xe')](_0x3f1c8b(null));};}for(var e in events){if(events[_0x5c12('0xf')](e)){var event=events[e];WhatsappInteraction[_0x5c12('0x10')](e,emitEvent(event));}}module[_0x5c12('0x11')]=WhatsappInteractionEvents;
\ No newline at end of file
+var _0x3d7f=['setMaxListeners','save','update','then','setDataValue','map','findAll','unreadMessages','length','emit','catch','exports','events','WhatsappInteraction','WhatsappMessage'];(function(_0x1123bb,_0x54472a){var _0xdeb602=function(_0x529467){while(--_0x529467){_0x1123bb['push'](_0x1123bb['shift']());}};_0xdeb602(++_0x54472a);}(_0x3d7f,0x1a1));var _0xf3d7=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0x3d7f[_0x5c3c0b];return _0x52ecd2;};'use strict';var EventEmitter=require(_0xf3d7('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0xf3d7('0x1')];var WhatsappMessage=require('../../mysqldb')['db'][_0xf3d7('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xf3d7('0x3')](0x0);var events={'afterCreate':_0xf3d7('0x4'),'afterUpdate':_0xf3d7('0x5'),'afterDestroy':'remove'};function emitEvent(_0x574073){return function(_0x433483,_0x20fb37,_0x5b667c){_0x433483['getUsers']({'attributes':['id'],'raw':!![]})[_0xf3d7('0x6')](function(_0x17d875){_0x433483[_0xf3d7('0x7')]('Users',_0x17d875[_0xf3d7('0x8')](function(_0x2d2bcd){return{'id':_0x2d2bcd['id']};}));return WhatsappMessage[_0xf3d7('0x9')]({'where':{'WhatsappInteractionId':_0x433483['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf3d7('0x6')](function(_0x167637){_0x433483[_0xf3d7('0x7')](_0xf3d7('0xa'),_0x167637[_0xf3d7('0xb')]);WhatsappInteractionEvents[_0xf3d7('0xc')](_0x574073+':'+_0x433483['id'],_0x433483);WhatsappInteractionEvents[_0xf3d7('0xc')](_0x574073,_0x433483);_0x5b667c(null);})[_0xf3d7('0xd')](_0x5b667c(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0xf3d7('0xe')]=WhatsappInteractionEvents;
\ No newline at end of file