Built motion from commit e6806ed6.|2.6.0
[motion2.git] / server / api / openchannelInteraction / openchannelInteraction.events.js
index 5c673ff..c042928 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 _0x2dec=['Users','then','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','OpenchannelMessage','save','update','remove','getUsers','setDataValue'];(function(_0x4c4042,_0x1ea485){var _0xbd10dc=function(_0x164b20){while(--_0x164b20){_0x4c4042['push'](_0x4c4042['shift']());}};_0xbd10dc(++_0x1ea485);}(_0x2dec,0x138));var _0xc2de=function(_0x319412,_0x3e5995){_0x319412=_0x319412-0x0;var _0x2d78b3=_0x2dec[_0x319412];return _0x2d78b3;};'use strict';var EventEmitter=require(_0xc2de('0x0'));var OpenchannelInteraction=require(_0xc2de('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0xc2de('0x1'))['db'][_0xc2de('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc2de('0x3'),'afterUpdate':_0xc2de('0x4'),'afterDestroy':_0xc2de('0x5')};function emitEvent(_0x5b5ea4){return function(_0x948203,_0x4dede9,_0x1f51fb){_0x948203[_0xc2de('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1459c1){_0x948203[_0xc2de('0x7')](_0xc2de('0x8'),_0x1459c1['map'](function(_0x146c0c){return{'id':_0x146c0c['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x948203['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc2de('0x9')](function(_0x2279c7){_0x948203['setDataValue'](_0xc2de('0xa'),_0x2279c7[_0xc2de('0xb')]);OpenchannelInteractionEvents['emit'](_0x5b5ea4+':'+_0x948203['id'],_0x948203);OpenchannelInteractionEvents[_0xc2de('0xc')](_0x5b5ea4,_0x948203);_0x1f51fb(null);})[_0xc2de('0xd')](_0x1f51fb(null));};}for(var e in events){if(events[_0xc2de('0xe')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0xc2de('0xf')]=OpenchannelInteractionEvents;
\ No newline at end of file