Built motion from commit fe909640.|2.6.8
[motion2.git] / server / api / faxInteraction / faxInteraction.events.js
index 639a740..066f341 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bbb=['catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','setMaxListeners','save','update','remove','getUsers','setDataValue','Users','map','findAll','then','emit'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x9bbb,0x148));var _0xb9bb=function(_0x5f28d9,_0x16dccb){_0x5f28d9=_0x5f28d9-0x0;var _0x4ce5c4=_0x9bbb[_0x5f28d9];return _0x4ce5c4;};'use strict';var EventEmitter=require(_0xb9bb('0x0'));var FaxInteraction=require(_0xb9bb('0x1'))['db'][_0xb9bb('0x2')];var FaxMessage=require('../../mysqldb')['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xb9bb('0x3')](0x0);var events={'afterCreate':_0xb9bb('0x4'),'afterUpdate':_0xb9bb('0x5'),'afterDestroy':_0xb9bb('0x6')};function emitEvent(_0x4ffde3){return function(_0x2d25b2,_0x42f002,_0x4914ab){_0x2d25b2[_0xb9bb('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4dd642){_0x2d25b2[_0xb9bb('0x8')](_0xb9bb('0x9'),_0x4dd642[_0xb9bb('0xa')](function(_0xcf1d2c){return{'id':_0xcf1d2c['id']};}));return FaxMessage[_0xb9bb('0xb')]({'where':{'FaxInteractionId':_0x2d25b2['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb9bb('0xc')](function(_0x58f90e){_0x2d25b2[_0xb9bb('0x8')]('unreadMessages',_0x58f90e['length']);FaxInteractionEvents['emit'](_0x4ffde3+':'+_0x2d25b2['id'],_0x2d25b2);FaxInteractionEvents[_0xb9bb('0xd')](_0x4ffde3,_0x2d25b2);_0x4914ab(null);})[_0xb9bb('0xe')](_0x4914ab(null));};}for(var e in events){if(events[_0xb9bb('0xf')](e)){var event=events[e];FaxInteraction[_0xb9bb('0x10')](e,emitEvent(event));}}module[_0xb9bb('0x11')]=FaxInteractionEvents;
\ No newline at end of file
+var _0xf3cf=['then','setDataValue','Users','map','findAll','emit','catch','hasOwnProperty','exports','events','../../mysqldb','FaxMessage','save','update','getUsers'];(function(_0x155581,_0x1e443e){var _0x552a91=function(_0x37b9d2){while(--_0x37b9d2){_0x155581['push'](_0x155581['shift']());}};_0x552a91(++_0x1e443e);}(_0xf3cf,0x81));var _0xff3c=function(_0x257642,_0x270a80){_0x257642=_0x257642-0x0;var _0x3d813b=_0xf3cf[_0x257642];return _0x3d813b;};'use strict';var EventEmitter=require(_0xff3c('0x0'));var FaxInteraction=require(_0xff3c('0x1'))['db']['FaxInteraction'];var FaxMessage=require('../../mysqldb')['db'][_0xff3c('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xff3c('0x3'),'afterUpdate':_0xff3c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3f82ef){return function(_0x5f4fa3,_0x4fb1ed,_0xe95c76){_0x5f4fa3[_0xff3c('0x5')]({'attributes':['id'],'raw':!![]})[_0xff3c('0x6')](function(_0x42ffdd){_0x5f4fa3[_0xff3c('0x7')](_0xff3c('0x8'),_0x42ffdd[_0xff3c('0x9')](function(_0x2c0977){return{'id':_0x2c0977['id']};}));return FaxMessage[_0xff3c('0xa')]({'where':{'FaxInteractionId':_0x5f4fa3['id'],'direction':'in','read':![]},'raw':!![]});})[_0xff3c('0x6')](function(_0x1b87d1){_0x5f4fa3[_0xff3c('0x7')]('unreadMessages',_0x1b87d1['length']);FaxInteractionEvents[_0xff3c('0xb')](_0x3f82ef+':'+_0x5f4fa3['id'],_0x5f4fa3);FaxInteractionEvents[_0xff3c('0xb')](_0x3f82ef,_0x5f4fa3);_0xe95c76(null);})[_0xff3c('0xc')](_0xe95c76(null));};}for(var e in events){if(events[_0xff3c('0xd')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0xff3c('0xe')]=FaxInteractionEvents;
\ No newline at end of file