Built motion from commit 9e1399f3.|2.5.37
[motion2.git] / server / api / faxInteraction / faxInteraction.events.js
index cd3f256..9dd465d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','then','setDataValue','Users','unreadMessages','length','emit','hasOwnProperty','exports','events'];(function(_0x157cfe,_0x40829d){var _0x4c4da2=function(_0x559db2){while(--_0x559db2){_0x157cfe['push'](_0x157cfe['shift']());}};_0x4c4da2(++_0x40829d);}(_0x326f,0xd1));var _0xf326=function(_0x40501f,_0x13b15d){_0x40501f=_0x40501f-0x0;var _0x29e27d=_0x326f[_0x40501f];return _0x29e27d;};'use strict';var EventEmitter=require(_0xf326('0x0'));var FaxInteraction=require('../../mysqldb')['db']['FaxInteraction'];var FaxMessage=require(_0xf326('0x1'))['db'][_0xf326('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xf326('0x3')](0x0);var events={'afterCreate':_0xf326('0x4'),'afterUpdate':_0xf326('0x5'),'afterDestroy':_0xf326('0x6')};function emitEvent(_0x9445c6){return function(_0xf1c243,_0x1b5a56,_0x3ace29){_0xf1c243['getUsers']({'attributes':['id'],'raw':!![]})[_0xf326('0x7')](function(_0x3851eb){_0xf1c243[_0xf326('0x8')](_0xf326('0x9'),_0x3851eb['map'](function(_0x4c206c){return{'id':_0x4c206c['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0xf1c243['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf326('0x7')](function(_0x1fc80e){_0xf1c243[_0xf326('0x8')](_0xf326('0xa'),_0x1fc80e[_0xf326('0xb')]);FaxInteractionEvents['emit'](_0x9445c6+':'+_0xf1c243['id'],_0xf1c243);FaxInteractionEvents[_0xf326('0xc')](_0x9445c6,_0xf1c243);_0x3ace29(null);})['catch'](_0x3ace29(null));};}for(var e in events){if(events[_0xf326('0xd')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0xf326('0xe')]=FaxInteractionEvents;
\ No newline at end of file
+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