Built motion from commit 14588770.|2.5.38
[motion2.git] / server / api / faxInteraction / faxInteraction.events.js
index 9dd465d..5249302 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb66=['FaxMessage','setMaxListeners','save','remove','getUsers','setDataValue','map','findAll','then','unreadMessages','emit','catch','exports','events','../../mysqldb','FaxInteraction'];(function(_0xaa51e0,_0x388691){var _0x5cbbba=function(_0x21cc84){while(--_0x21cc84){_0xaa51e0['push'](_0xaa51e0['shift']());}};_0x5cbbba(++_0x388691);}(_0xdb66,0xad));var _0x6db6=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xdb66[_0x3b5250];return _0xc844a1;};'use strict';var EventEmitter=require(_0x6db6('0x0'));var FaxInteraction=require(_0x6db6('0x1'))['db'][_0x6db6('0x2')];var FaxMessage=require('../../mysqldb')['db'][_0x6db6('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x6db6('0x4')](0x0);var events={'afterCreate':_0x6db6('0x5'),'afterUpdate':'update','afterDestroy':_0x6db6('0x6')};function emitEvent(_0xe4dcf0){return function(_0x351e52,_0x5b69d9,_0x143e3c){_0x351e52[_0x6db6('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1b1106){_0x351e52[_0x6db6('0x8')]('Users',_0x1b1106[_0x6db6('0x9')](function(_0x54d99d){return{'id':_0x54d99d['id']};}));return FaxMessage[_0x6db6('0xa')]({'where':{'FaxInteractionId':_0x351e52['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6db6('0xb')](function(_0x2165ff){_0x351e52[_0x6db6('0x8')](_0x6db6('0xc'),_0x2165ff['length']);FaxInteractionEvents[_0x6db6('0xd')](_0xe4dcf0+':'+_0x351e52['id'],_0x351e52);FaxInteractionEvents[_0x6db6('0xd')](_0xe4dcf0,_0x351e52);_0x143e3c(null);})[_0x6db6('0xe')](_0x143e3c(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x6db6('0xf')]=FaxInteractionEvents;
\ No newline at end of file
+var _0x9f25=['setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','FaxInteraction','FaxMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9f25,0x12c));var _0x59f2=function(_0x3d1996,_0x1f08f0){_0x3d1996=_0x3d1996-0x0;var _0x550afd=_0x9f25[_0x3d1996];return _0x550afd;};'use strict';var EventEmitter=require(_0x59f2('0x0'));var FaxInteraction=require(_0x59f2('0x1'))['db'][_0x59f2('0x2')];var FaxMessage=require(_0x59f2('0x1'))['db'][_0x59f2('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x59f2('0x4')](0x0);var events={'afterCreate':_0x59f2('0x5'),'afterUpdate':_0x59f2('0x6'),'afterDestroy':_0x59f2('0x7')};function emitEvent(_0x20cf3a){return function(_0x4fa4a5,_0x51c0ac,_0x312efd){_0x4fa4a5[_0x59f2('0x8')]({'attributes':['id'],'raw':!![]})[_0x59f2('0x9')](function(_0x3ebb8f){_0x4fa4a5[_0x59f2('0xa')](_0x59f2('0xb'),_0x3ebb8f[_0x59f2('0xc')](function(_0x229b2a){return{'id':_0x229b2a['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x4fa4a5['id'],'direction':'in','read':![]},'raw':!![]});})[_0x59f2('0x9')](function(_0x201fbd){_0x4fa4a5[_0x59f2('0xa')](_0x59f2('0xd'),_0x201fbd[_0x59f2('0xe')]);FaxInteractionEvents['emit'](_0x20cf3a+':'+_0x4fa4a5['id'],_0x4fa4a5);FaxInteractionEvents[_0x59f2('0xf')](_0x20cf3a,_0x4fa4a5);_0x312efd(null);})[_0x59f2('0x10')](_0x312efd(null));};}for(var e in events){if(events[_0x59f2('0x11')](e)){var event=events[e];FaxInteraction[_0x59f2('0x12')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents;
\ No newline at end of file