Built motion from commit (unavailable).|2.5.15
[motion2.git] / server / api / whatsappInteraction / whatsappInteraction.events.js
index 3a4c0b3..b407dd9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa6ff=['WhatsappMessage','setMaxListeners','save','remove','then','setDataValue','Users','findAll','unreadMessages','emit','catch','hasOwnProperty','exports','events','../../mysqldb','WhatsappInteraction'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xa6ff,0x8d));var _0xfa6f=function(_0x1cc372,_0x79999){_0x1cc372=_0x1cc372-0x0;var _0x1c8203=_0xa6ff[_0x1cc372];return _0x1c8203;};'use strict';var EventEmitter=require(_0xfa6f('0x0'));var WhatsappInteraction=require(_0xfa6f('0x1'))['db'][_0xfa6f('0x2')];var WhatsappMessage=require(_0xfa6f('0x1'))['db'][_0xfa6f('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xfa6f('0x4')](0x0);var events={'afterCreate':_0xfa6f('0x5'),'afterUpdate':'update','afterDestroy':_0xfa6f('0x6')};function emitEvent(_0x62f0bd){return function(_0x35598e,_0x56c159,_0x288524){_0x35598e['getUsers']({'attributes':['id'],'raw':!![]})[_0xfa6f('0x7')](function(_0x81ddef){_0x35598e[_0xfa6f('0x8')](_0xfa6f('0x9'),_0x81ddef['map'](function(_0x5f233d){return{'id':_0x5f233d['id']};}));return WhatsappMessage[_0xfa6f('0xa')]({'where':{'WhatsappInteractionId':_0x35598e['id'],'direction':'in','read':![]},'raw':!![]});})[_0xfa6f('0x7')](function(_0x5a960c){_0x35598e[_0xfa6f('0x8')](_0xfa6f('0xb'),_0x5a960c['length']);WhatsappInteractionEvents['emit'](_0x62f0bd+':'+_0x35598e['id'],_0x35598e);WhatsappInteractionEvents[_0xfa6f('0xc')](_0x62f0bd,_0x35598e);_0x288524(null);})[_0xfa6f('0xd')](_0x288524(null));};}for(var e in events){if(events[_0xfa6f('0xe')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0xfa6f('0xf')]=WhatsappInteractionEvents;
\ No newline at end of file
+var _0xd6fb=['length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','Users','map','unreadMessages'];(function(_0x1f0ec6,_0x5b152b){var _0x1f1619=function(_0x345886){while(--_0x345886){_0x1f0ec6['push'](_0x1f0ec6['shift']());}};_0x1f1619(++_0x5b152b);}(_0xd6fb,0xba));var _0xbd6f=function(_0x5ae6f0,_0x4733a9){_0x5ae6f0=_0x5ae6f0-0x0;var _0x23f4e1=_0xd6fb[_0x5ae6f0];return _0x23f4e1;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0xbd6f('0x0'))['db'][_0xbd6f('0x1')];var WhatsappMessage=require('../../mysqldb')['db'][_0xbd6f('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xbd6f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbd6f('0x4'),'afterDestroy':_0xbd6f('0x5')};function emitEvent(_0x17ac0e){return function(_0x4a3de0,_0x20b8ed,_0xa8e9ed){_0x4a3de0[_0xbd6f('0x6')]({'attributes':['id'],'raw':!![]})[_0xbd6f('0x7')](function(_0x4bc5de){_0x4a3de0[_0xbd6f('0x8')](_0xbd6f('0x9'),_0x4bc5de[_0xbd6f('0xa')](function(_0x5a532e){return{'id':_0x5a532e['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x4a3de0['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbd6f('0x7')](function(_0x396dbf){_0x4a3de0[_0xbd6f('0x8')](_0xbd6f('0xb'),_0x396dbf[_0xbd6f('0xc')]);WhatsappInteractionEvents[_0xbd6f('0xd')](_0x17ac0e+':'+_0x4a3de0['id'],_0x4a3de0);WhatsappInteractionEvents['emit'](_0x17ac0e,_0x4a3de0);_0xa8e9ed(null);})[_0xbd6f('0xe')](_0xa8e9ed(null));};}for(var e in events){if(events[_0xbd6f('0xf')](e)){var event=events[e];WhatsappInteraction[_0xbd6f('0x10')](e,emitEvent(event));}}module[_0xbd6f('0x11')]=WhatsappInteractionEvents;
\ No newline at end of file