Built motion from commit eddce310.|2.6.12
[motion2.git] / server / api / faxInteraction / faxInteraction.events.js
index 6e759de..a19a6dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty','exports','../../mysqldb','FaxMessage','setMaxListeners'];(function(_0x2771b4,_0x191b27){var _0x56e70f=function(_0x20987c){while(--_0x20987c){_0x2771b4['push'](_0x2771b4['shift']());}};_0x56e70f(++_0x191b27);}(_0xadb5,0xad));var _0x5adb=function(_0x5a5b8f,_0x206ae6){_0x5a5b8f=_0x5a5b8f-0x0;var _0x47e320=_0xadb5[_0x5a5b8f];return _0x47e320;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x5adb('0x0'))['db']['FaxInteraction'];var FaxMessage=require(_0x5adb('0x0'))['db'][_0x5adb('0x1')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x5adb('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5adb('0x3'),'afterDestroy':_0x5adb('0x4')};function emitEvent(_0x2e3ef4){return function(_0x4cb1d1,_0x35a5d3,_0x168d89){_0x4cb1d1[_0x5adb('0x5')]({'attributes':['id'],'raw':!![]})[_0x5adb('0x6')](function(_0xdf3776){_0x4cb1d1[_0x5adb('0x7')](_0x5adb('0x8'),_0xdf3776[_0x5adb('0x9')](function(_0x41261c){return{'id':_0x41261c['id']};}));return FaxMessage[_0x5adb('0xa')]({'where':{'FaxInteractionId':_0x4cb1d1['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5adb('0x6')](function(_0x336bad){_0x4cb1d1[_0x5adb('0x7')](_0x5adb('0xb'),_0x336bad['length']);FaxInteractionEvents['emit'](_0x2e3ef4+':'+_0x4cb1d1['id'],_0x4cb1d1);FaxInteractionEvents[_0x5adb('0xc')](_0x2e3ef4,_0x4cb1d1);_0x168d89(null);})[_0x5adb('0xd')](_0x168d89(null));};}for(var e in events){if(events[_0x5adb('0xe')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x5adb('0xf')]=FaxInteractionEvents;
\ No newline at end of file
+var _0x30ab=['unreadMessages','emit','hasOwnProperty','events','FaxMessage','setMaxListeners','save','update','remove','getUsers','then','map','setDataValue'];(function(_0x13c82f,_0x353a63){var _0x117e17=function(_0xeeabe7){while(--_0xeeabe7){_0x13c82f['push'](_0x13c82f['shift']());}};_0x117e17(++_0x353a63);}(_0x30ab,0x6b));var _0xb30a=function(_0x6b0702,_0x1e459f){_0x6b0702=_0x6b0702-0x0;var _0x126c0f=_0x30ab[_0x6b0702];return _0x126c0f;};'use strict';var EventEmitter=require(_0xb30a('0x0'));var FaxInteraction=require('../../mysqldb')['db']['FaxInteraction'];var FaxMessage=require('../../mysqldb')['db'][_0xb30a('0x1')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xb30a('0x2')](0x0);var events={'afterCreate':_0xb30a('0x3'),'afterUpdate':_0xb30a('0x4'),'afterDestroy':_0xb30a('0x5')};function emitEvent(_0x29dccf){return function(_0x4669e5,_0x15937d,_0x1de920){_0x4669e5[_0xb30a('0x6')]({'attributes':['id'],'raw':!![]})[_0xb30a('0x7')](function(_0x228a33){_0x4669e5['setDataValue']('Users',_0x228a33[_0xb30a('0x8')](function(_0x101789){return{'id':_0x101789['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x4669e5['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb30a('0x7')](function(_0x24f277){_0x4669e5[_0xb30a('0x9')](_0xb30a('0xa'),_0x24f277['length']);FaxInteractionEvents[_0xb30a('0xb')](_0x29dccf+':'+_0x4669e5['id'],_0x4669e5);FaxInteractionEvents[_0xb30a('0xb')](_0x29dccf,_0x4669e5);_0x1de920(null);})['catch'](_0x1de920(null));};}for(var e in events){if(events[_0xb30a('0xc')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module['exports']=FaxInteractionEvents;
\ No newline at end of file