Built motion from commit b517aaa2a6638133380e4d135c64a80893061362. Version 3.0.0...
[motion-next.git] / server / api / openchannelInteraction / openchannelInteraction.events.js
index 90f4a80..f0868d9 100644 (file)
@@ -1 +1 @@
-const a481_0x2c24=['save','../../mysqldb','catch','findAll','setMaxListeners','setDataValue','update','addHook','length','exports','OpenchannelMessage','OpenchannelInteraction','unreadMessages','map','Users'];(function(_0x4bf9b7,_0x2c2446){const _0x3bf082=function(_0x205b10){while(--_0x205b10){_0x4bf9b7['push'](_0x4bf9b7['shift']());}};_0x3bf082(++_0x2c2446);}(a481_0x2c24,0x132));const a481_0x3bf0=function(_0x4bf9b7,_0x2c2446){_0x4bf9b7=_0x4bf9b7-0x0;let _0x3bf082=a481_0x2c24[_0x4bf9b7];return _0x3bf082;};const _0x553a61=a481_0x3bf0;'use strict';const EventEmitter=require('events'),OpenchannelInteraction=require(_0x553a61('0xa'))['db'][_0x553a61('0x5')],OpenchannelMessage=require('../../mysqldb')['db'][_0x553a61('0x4')],OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x553a61('0xd')](0x0);const events={'afterCreate':_0x553a61('0x9'),'afterUpdate':_0x553a61('0x0'),'afterDestroy':'remove'};function emitEvent(_0x205b10){return function(_0xdb8dda){const _0x2c91d7=a481_0x3bf0;_0xdb8dda['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x5c991b){const _0x3ec713=a481_0x3bf0;return _0xdb8dda[_0x3ec713('0xe')](_0x3ec713('0x8'),_0x5c991b[_0x3ec713('0x7')](function(_0x138a5e){return{'id':_0x138a5e['id']};})),OpenchannelMessage[_0x3ec713('0xc')]({'where':{'OpenchannelInteractionId':_0xdb8dda['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x31df43){const _0x26067e=a481_0x3bf0;_0xdb8dda['setDataValue'](_0x26067e('0x6'),_0x31df43[_0x26067e('0x2')]),OpenchannelInteractionEvents['emit'](_0x205b10+':'+_0xdb8dda['id'],_0xdb8dda),OpenchannelInteractionEvents['emit'](_0x205b10,_0xdb8dda);})[_0x2c91d7('0xb')](()=>{});};}for(const e in events){if(typeof events[e]!=='undefined'){const event=events[e];OpenchannelInteraction[_0x553a61('0x1')](e,emitEvent(event));}}module[_0x553a61('0x3')]=OpenchannelInteractionEvents;
\ No newline at end of file
+const a481_0x25ef=['setDataValue','OpenchannelMessage','unreadMessages','findAll','events','setMaxListeners','remove','Users','map','exports','emit','length','update','getUsers','addHook','../../mysqldb','OpenchannelInteraction','then'];(function(_0x5e346a,_0x25efdd){const _0x3ac472=function(_0x36fbc3){while(--_0x36fbc3){_0x5e346a['push'](_0x5e346a['shift']());}};_0x3ac472(++_0x25efdd);}(a481_0x25ef,0x17c));const a481_0x3ac4=function(_0x5e346a,_0x25efdd){_0x5e346a=_0x5e346a-0x0;let _0x3ac472=a481_0x25ef[_0x5e346a];return _0x3ac472;};const _0x188240=a481_0x3ac4;'use strict';const EventEmitter=require(_0x188240('0x2')),OpenchannelInteraction=require(_0x188240('0xd'))['db'][_0x188240('0xe')],OpenchannelMessage=require(_0x188240('0xd'))['db'][_0x188240('0x11')],OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x188240('0x3')](0x0);const events={'afterCreate':'save','afterUpdate':_0x188240('0xa'),'afterDestroy':_0x188240('0x4')};function emitEvent(_0x36fbc3){return function(_0x472b16){const _0x59ce0a=a481_0x3ac4;_0x472b16[_0x59ce0a('0xb')]({'attributes':['id'],'raw':!![]})[_0x59ce0a('0xf')](function(_0x3f0788){const _0x4038f9=_0x59ce0a;return _0x472b16['setDataValue'](_0x4038f9('0x5'),_0x3f0788[_0x4038f9('0x6')](function(_0x25da28){return{'id':_0x25da28['id']};})),OpenchannelMessage[_0x4038f9('0x1')]({'where':{'OpenchannelInteractionId':_0x472b16['id'],'direction':'in','read':![]},'raw':!![]});})[_0x59ce0a('0xf')](function(_0xb9d7cd){const _0x310157=_0x59ce0a;_0x472b16[_0x310157('0x10')](_0x310157('0x0'),_0xb9d7cd[_0x310157('0x9')]),OpenchannelInteractionEvents[_0x310157('0x8')](_0x36fbc3+':'+_0x472b16['id'],_0x472b16),OpenchannelInteractionEvents['emit'](_0x36fbc3,_0x472b16);})['catch'](()=>{});};}for(const e in events){if(typeof events[e]!=='undefined'){const event=events[e];OpenchannelInteraction[_0x188240('0xc')](e,emitEvent(event));}}module[_0x188240('0x7')]=OpenchannelInteractionEvents;
\ No newline at end of file