Built motion from commit (unavailable).|2.5.18
[motion2.git] / server / api / openchannelInteraction / openchannelInteraction.events.js
index 5c673ff..93b652c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x464b=['map','findAll','unreadMessages','length','emit','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x464b,0x149));var _0xb464=function(_0x39fd91,_0x146a90){_0x39fd91=_0x39fd91-0x0;var _0x3c3e49=_0x464b[_0x39fd91];return _0x3c3e49;};'use strict';var EventEmitter=require(_0xb464('0x0'));var OpenchannelInteraction=require(_0xb464('0x1'))['db'][_0xb464('0x2')];var OpenchannelMessage=require(_0xb464('0x1'))['db'][_0xb464('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xb464('0x4')](0x0);var events={'afterCreate':_0xb464('0x5'),'afterUpdate':_0xb464('0x6'),'afterDestroy':_0xb464('0x7')};function emitEvent(_0x2b4525){return function(_0x345d80,_0x21e64c,_0x23669b){_0x345d80[_0xb464('0x8')]({'attributes':['id'],'raw':!![]})[_0xb464('0x9')](function(_0x442bdb){_0x345d80[_0xb464('0xa')]('Users',_0x442bdb[_0xb464('0xb')](function(_0x3b4d1e){return{'id':_0x3b4d1e['id']};}));return OpenchannelMessage[_0xb464('0xc')]({'where':{'OpenchannelInteractionId':_0x345d80['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb464('0x9')](function(_0x36a191){_0x345d80[_0xb464('0xa')](_0xb464('0xd'),_0x36a191[_0xb464('0xe')]);OpenchannelInteractionEvents[_0xb464('0xf')](_0x2b4525+':'+_0x345d80['id'],_0x345d80);OpenchannelInteractionEvents['emit'](_0x2b4525,_0x345d80);_0x23669b(null);})['catch'](_0x23669b(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0xb464('0x10')]=OpenchannelInteractionEvents;
\ No newline at end of file
+var _0xee1a=['../../mysqldb','OpenchannelMessage','save','update','remove','getUsers','then','setDataValue','map','unreadMessages','emit','catch','hasOwnProperty','hook','exports','events'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xee1a,0x15f));var _0xaee1=function(_0x248fb7,_0x731897){_0x248fb7=_0x248fb7-0x0;var _0x235800=_0xee1a[_0x248fb7];return _0x235800;};'use strict';var EventEmitter=require(_0xaee1('0x0'));var OpenchannelInteraction=require(_0xaee1('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0xaee1('0x1'))['db'][_0xaee1('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xaee1('0x3'),'afterUpdate':_0xaee1('0x4'),'afterDestroy':_0xaee1('0x5')};function emitEvent(_0x3cea38){return function(_0x1a81c6,_0x358e5b,_0x464f91){_0x1a81c6[_0xaee1('0x6')]({'attributes':['id'],'raw':!![]})[_0xaee1('0x7')](function(_0x3ebdfe){_0x1a81c6[_0xaee1('0x8')]('Users',_0x3ebdfe[_0xaee1('0x9')](function(_0x1c8251){return{'id':_0x1c8251['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x1a81c6['id'],'direction':'in','read':![]},'raw':!![]});})[_0xaee1('0x7')](function(_0x14e829){_0x1a81c6['setDataValue'](_0xaee1('0xa'),_0x14e829['length']);OpenchannelInteractionEvents[_0xaee1('0xb')](_0x3cea38+':'+_0x1a81c6['id'],_0x1a81c6);OpenchannelInteractionEvents[_0xaee1('0xb')](_0x3cea38,_0x1a81c6);_0x464f91(null);})[_0xaee1('0xc')](_0x464f91(null));};}for(var e in events){if(events[_0xaee1('0xd')](e)){var event=events[e];OpenchannelInteraction[_0xaee1('0xe')](e,emitEvent(event));}}module[_0xaee1('0xf')]=OpenchannelInteractionEvents;
\ No newline at end of file