Built motion from commit 362b9399b4d0ed5560fbb795af995925d345fc38. Version 3.0.0...
[motion-next.git] / server / api / openchannelInteraction / openchannelInteraction.events.js
index 5078119..09e90c3 100644 (file)
@@ -1 +1 @@
-const a578_0x1ee3=['then','map','Users','remove','undefined','setMaxListeners','exports','findAll','OpenchannelInteraction','emit','save','../../mysqldb','events','catch','OpenchannelMessage','getUsers','setDataValue'];(function(_0x4e5018,_0x755062){const _0x1ee31a=function(_0x295d17){while(--_0x295d17){_0x4e5018['push'](_0x4e5018['shift']());}};_0x1ee31a(++_0x755062);}(a578_0x1ee3,0x1c0));const a578_0x295d=function(_0x4e5018,_0x755062){_0x4e5018=_0x4e5018-0x177;let _0x1ee31a=a578_0x1ee3[_0x4e5018];return _0x1ee31a;};const a578_0x13a979=a578_0x295d;'use strict';const EventEmitter=require(a578_0x13a979(0x17d)),OpenchannelInteraction=require('../../mysqldb')['db'][a578_0x13a979(0x179)],OpenchannelMessage=require(a578_0x13a979(0x17c))['db'][a578_0x13a979(0x17f)],OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[a578_0x13a979(0x187)](0x0);const events={'afterCreate':a578_0x13a979(0x17b),'afterUpdate':'update','afterDestroy':a578_0x13a979(0x185)};function emitEvent(_0x17eb65){return function(_0x39e369){const _0x4a7896=a578_0x295d;_0x39e369[_0x4a7896(0x180)]({'attributes':['id'],'raw':!![]})[_0x4a7896(0x182)](function(_0x2d0735){const _0x2fadd5=_0x4a7896;return _0x39e369[_0x2fadd5(0x181)](_0x2fadd5(0x184),_0x2d0735[_0x2fadd5(0x183)](function(_0x4eaa98){return{'id':_0x4eaa98['id']};})),OpenchannelMessage[_0x2fadd5(0x178)]({'where':{'OpenchannelInteractionId':_0x39e369['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4a7896(0x182)](function(_0xf026bf){const _0x5f0c62=_0x4a7896;_0x39e369['setDataValue']('unreadMessages',_0xf026bf['length']),OpenchannelInteractionEvents[_0x5f0c62(0x17a)](_0x17eb65+':'+_0x39e369['id'],_0x39e369),OpenchannelInteractionEvents[_0x5f0c62(0x17a)](_0x17eb65,_0x39e369);})[_0x4a7896(0x17e)](()=>{});};}for(const e in events){if(typeof events[e]!==a578_0x13a979(0x186)){const event=events[e];OpenchannelInteraction['addHook'](e,emitEvent(event));}}module[a578_0x13a979(0x177)]=OpenchannelInteractionEvents;
\ No newline at end of file
+const a578_0x4adc=['remove','setDataValue','then','exports','OpenchannelInteraction','Users','events','OpenchannelMessage','findAll','emit','catch','length','../../mysqldb','setMaxListeners'];(function(_0x2fb281,_0x2f1d32){const _0x4adc89=function(_0x59eb2d){while(--_0x59eb2d){_0x2fb281['push'](_0x2fb281['shift']());}};_0x4adc89(++_0x2f1d32);}(a578_0x4adc,0x118));const a578_0x59eb=function(_0x2fb281,_0x2f1d32){_0x2fb281=_0x2fb281-0x65;let _0x4adc89=a578_0x4adc[_0x2fb281];return _0x4adc89;};const a578_0x365f76=a578_0x59eb;'use strict';const EventEmitter=require(a578_0x365f76(0x6b)),OpenchannelInteraction=require('../../mysqldb')['db'][a578_0x365f76(0x69)],OpenchannelMessage=require(a578_0x365f76(0x71))['db'][a578_0x365f76(0x6c)],OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[a578_0x365f76(0x72)](0x0);const events={'afterCreate':'save','afterUpdate':'update','afterDestroy':a578_0x365f76(0x65)};function emitEvent(_0xbd815e){return function(_0x3dbb2b){const _0x5dca2b=a578_0x59eb;_0x3dbb2b['getUsers']({'attributes':['id'],'raw':!![]})[_0x5dca2b(0x67)](function(_0x44e215){const _0x452e86=_0x5dca2b;return _0x3dbb2b[_0x452e86(0x66)](_0x452e86(0x6a),_0x44e215['map'](function(_0xbed49d){return{'id':_0xbed49d['id']};})),OpenchannelMessage[_0x452e86(0x6d)]({'where':{'OpenchannelInteractionId':_0x3dbb2b['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5dca2b(0x67)](function(_0x39fa12){const _0x27c074=_0x5dca2b;_0x3dbb2b[_0x27c074(0x66)]('unreadMessages',_0x39fa12[_0x27c074(0x70)]),OpenchannelInteractionEvents[_0x27c074(0x6e)](_0xbd815e+':'+_0x3dbb2b['id'],_0x3dbb2b),OpenchannelInteractionEvents[_0x27c074(0x6e)](_0xbd815e,_0x3dbb2b);})[_0x5dca2b(0x6f)](()=>{});};}for(const e in events){if(typeof events[e]!=='undefined'){const event=events[e];OpenchannelInteraction['addHook'](e,emitEvent(event));}}module[a578_0x365f76(0x68)]=OpenchannelInteractionEvents;
\ No newline at end of file