Built motion from commit 0900f080.|2.5.45
[motion2.git] / server / api / faxInteraction / faxInteraction.events.js
index 11b5d3b..e4ba32a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x78f0=['FaxMessage','setMaxListeners','save','update','getUsers','setDataValue','unreadMessages','length','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x4d4e87,_0x3da0bc){var _0x580ca3=function(_0x4a2ca0){while(--_0x4a2ca0){_0x4d4e87['push'](_0x4d4e87['shift']());}};_0x580ca3(++_0x3da0bc);}(_0x78f0,0x15a));var _0x078f=function(_0x1d090b,_0x54ecbe){_0x1d090b=_0x1d090b-0x0;var _0xa76aa9=_0x78f0[_0x1d090b];return _0xa76aa9;};'use strict';var EventEmitter=require(_0x078f('0x0'));var FaxInteraction=require(_0x078f('0x1'))['db']['FaxInteraction'];var FaxMessage=require(_0x078f('0x1'))['db'][_0x078f('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x078f('0x3')](0x0);var events={'afterCreate':_0x078f('0x4'),'afterUpdate':_0x078f('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1c5065){return function(_0x31ff9c,_0xe4ef91,_0x464b9e){_0x31ff9c[_0x078f('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x39d7be){_0x31ff9c[_0x078f('0x7')]('Users',_0x39d7be['map'](function(_0x54d7a3){return{'id':_0x54d7a3['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x31ff9c['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x5712ee){_0x31ff9c[_0x078f('0x7')](_0x078f('0x8'),_0x5712ee[_0x078f('0x9')]);FaxInteractionEvents[_0x078f('0xa')](_0x1c5065+':'+_0x31ff9c['id'],_0x31ff9c);FaxInteractionEvents[_0x078f('0xa')](_0x1c5065,_0x31ff9c);_0x464b9e(null);})['catch'](_0x464b9e(null));};}for(var e in events){if(events[_0x078f('0xb')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module['exports']=FaxInteractionEvents;
\ No newline at end of file
+var _0x2ccf=['map','findAll','setDataValue','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','setMaxListeners','remove','getUsers','then','Users'];(function(_0x1d5fb9,_0x43aa73){var _0xd72009=function(_0x44052e){while(--_0x44052e){_0x1d5fb9['push'](_0x1d5fb9['shift']());}};_0xd72009(++_0x43aa73);}(_0x2ccf,0x1e5));var _0xf2cc=function(_0x5c50f0,_0x2c9b49){_0x5c50f0=_0x5c50f0-0x0;var _0x25d2b4=_0x2ccf[_0x5c50f0];return _0x25d2b4;};'use strict';var EventEmitter=require(_0xf2cc('0x0'));var FaxInteraction=require(_0xf2cc('0x1'))['db'][_0xf2cc('0x2')];var FaxMessage=require('../../mysqldb')['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xf2cc('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xf2cc('0x4')};function emitEvent(_0x5922fd){return function(_0x4a8465,_0x3fe59c,_0x583cb9){_0x4a8465[_0xf2cc('0x5')]({'attributes':['id'],'raw':!![]})[_0xf2cc('0x6')](function(_0x488a5f){_0x4a8465['setDataValue'](_0xf2cc('0x7'),_0x488a5f[_0xf2cc('0x8')](function(_0x563218){return{'id':_0x563218['id']};}));return FaxMessage[_0xf2cc('0x9')]({'where':{'FaxInteractionId':_0x4a8465['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf2cc('0x6')](function(_0x1927dc){_0x4a8465[_0xf2cc('0xa')]('unreadMessages',_0x1927dc[_0xf2cc('0xb')]);FaxInteractionEvents[_0xf2cc('0xc')](_0x5922fd+':'+_0x4a8465['id'],_0x4a8465);FaxInteractionEvents[_0xf2cc('0xc')](_0x5922fd,_0x4a8465);_0x583cb9(null);})[_0xf2cc('0xd')](_0x583cb9(null));};}for(var e in events){if(events[_0xf2cc('0xe')](e)){var event=events[e];FaxInteraction[_0xf2cc('0xf')](e,emitEvent(event));}}module[_0xf2cc('0x10')]=FaxInteractionEvents;
\ No newline at end of file