Built motion from commit c49361c37b5f784889c8087ac6e0e91b7e6b561a. Version 3.0.0...
[motion-next.git] / server / api / openchannelInteraction / openchannelInteraction.events.js
index 2701bb3..177a8ea 100644 (file)
@@ -1 +1 @@
-const a481_0x239c=['then','map','Users','remove','addHook','setDataValue','OpenchannelMessage','../../mysqldb','exports','undefined','emit','findAll','setMaxListeners','unreadMessages','length','save'];(function(_0xd158a2,_0x239cae){const _0x3d14d1=function(_0x4b132b){while(--_0x4b132b){_0xd158a2['push'](_0xd158a2['shift']());}};_0x3d14d1(++_0x239cae);}(a481_0x239c,0xeb));const a481_0x3d14=function(_0xd158a2,_0x239cae){_0xd158a2=_0xd158a2-0x0;let _0x3d14d1=a481_0x239c[_0xd158a2];return _0x3d14d1;};const _0x34f6c2=a481_0x3d14;'use strict';const EventEmitter=require('events'),OpenchannelInteraction=require(_0x34f6c2('0xc'))['db']['OpenchannelInteraction'],OpenchannelMessage=require(_0x34f6c2('0xc'))['db'][_0x34f6c2('0xb')],OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x34f6c2('0x1')](0x0);const events={'afterCreate':_0x34f6c2('0x4'),'afterUpdate':'update','afterDestroy':_0x34f6c2('0x8')};function emitEvent(_0x4b132b){return function(_0x4e0b37){const _0x104883=a481_0x3d14;_0x4e0b37['getUsers']({'attributes':['id'],'raw':!![]})[_0x104883('0x5')](function(_0x123337){const _0x118dbb=_0x104883;return _0x4e0b37[_0x118dbb('0xa')](_0x118dbb('0x7'),_0x123337[_0x118dbb('0x6')](function(_0x2d18d3){return{'id':_0x2d18d3['id']};})),OpenchannelMessage[_0x118dbb('0x0')]({'where':{'OpenchannelInteractionId':_0x4e0b37['id'],'direction':'in','read':![]},'raw':!![]});})[_0x104883('0x5')](function(_0x3f7bef){const _0x595291=_0x104883;_0x4e0b37[_0x595291('0xa')](_0x595291('0x2'),_0x3f7bef[_0x595291('0x3')]),OpenchannelInteractionEvents[_0x595291('0xf')](_0x4b132b+':'+_0x4e0b37['id'],_0x4e0b37),OpenchannelInteractionEvents[_0x595291('0xf')](_0x4b132b,_0x4e0b37);})['catch'](()=>{});};}for(const e in events){if(typeof events[e]!==_0x34f6c2('0xe')){const event=events[e];OpenchannelInteraction[_0x34f6c2('0x9')](e,emitEvent(event));}}module[_0x34f6c2('0xd')]=OpenchannelInteractionEvents;
\ No newline at end of file
+const a481_0x52f3=['OpenchannelMessage','setDataValue','findAll','exports','unreadMessages','OpenchannelInteraction','catch','emit','Users','getUsers','map','remove','setMaxListeners','addHook','events','then','../../mysqldb'];(function(_0x2b1635,_0x52f3f5){const _0x284100=function(_0x3cca47){while(--_0x3cca47){_0x2b1635['push'](_0x2b1635['shift']());}};_0x284100(++_0x52f3f5);}(a481_0x52f3,0x81));const a481_0x2841=function(_0x2b1635,_0x52f3f5){_0x2b1635=_0x2b1635-0x0;let _0x284100=a481_0x52f3[_0x2b1635];return _0x284100;};const _0x47924f=a481_0x2841;'use strict';const EventEmitter=require(_0x47924f('0x4')),OpenchannelInteraction=require(_0x47924f('0x6'))['db'][_0x47924f('0xc')],OpenchannelMessage=require(_0x47924f('0x6'))['db'][_0x47924f('0x7')],OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x47924f('0x2')](0x0);const events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x47924f('0x1')};function emitEvent(_0x3cca47){return function(_0x2590fb){const _0x436b08=a481_0x2841;_0x2590fb[_0x436b08('0x10')]({'attributes':['id'],'raw':!![]})[_0x436b08('0x5')](function(_0x47bf99){const _0x2efe1b=_0x436b08;return _0x2590fb[_0x2efe1b('0x8')](_0x2efe1b('0xf'),_0x47bf99[_0x2efe1b('0x0')](function(_0x4a5747){return{'id':_0x4a5747['id']};})),OpenchannelMessage[_0x2efe1b('0x9')]({'where':{'OpenchannelInteractionId':_0x2590fb['id'],'direction':'in','read':![]},'raw':!![]});})[_0x436b08('0x5')](function(_0x3f9fcd){const _0x876576=_0x436b08;_0x2590fb[_0x876576('0x8')](_0x876576('0xb'),_0x3f9fcd['length']),OpenchannelInteractionEvents['emit'](_0x3cca47+':'+_0x2590fb['id'],_0x2590fb),OpenchannelInteractionEvents[_0x876576('0xe')](_0x3cca47,_0x2590fb);})[_0x436b08('0xd')](()=>{});};}for(const e in events){if(typeof events[e]!=='undefined'){const event=events[e];OpenchannelInteraction[_0x47924f('0x3')](e,emitEvent(event));}}module[_0x47924f('0xa')]=OpenchannelInteractionEvents;
\ No newline at end of file