Built motion from commit f651e4b0a7312c0adceb5e57d6684a801a3aaf0d. Version 3.0.0...
[motion-next.git] / server / api / openchannelInteraction / openchannelInteraction.events.js
index 7aa58bf..2324221 100644 (file)
@@ -1 +1 @@
-const a481_0x3477=['findAll','setMaxListeners','then','OpenchannelInteraction','Users','emit','save','setDataValue','unreadMessages','getUsers','remove','../../mysqldb','addHook','exports','length'];(function(_0xd85760,_0x3477ec){const _0x574e10=function(_0x17bcbf){while(--_0x17bcbf){_0xd85760['push'](_0xd85760['shift']());}};_0x574e10(++_0x3477ec);}(a481_0x3477,0x75));const a481_0x574e=function(_0xd85760,_0x3477ec){_0xd85760=_0xd85760-0x0;let _0x574e10=a481_0x3477[_0xd85760];return _0x574e10;};const _0x299848=a481_0x574e;'use strict';const EventEmitter=require('events'),OpenchannelInteraction=require(_0x299848('0xe'))['db'][_0x299848('0x6')],OpenchannelMessage=require(_0x299848('0xe'))['db']['OpenchannelMessage'],OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x299848('0x4')](0x0);const events={'afterCreate':_0x299848('0x9'),'afterUpdate':'update','afterDestroy':_0x299848('0xd')};function emitEvent(_0x17bcbf){return function(_0x44a3cb){const _0x39020d=a481_0x574e;_0x44a3cb[_0x39020d('0xc')]({'attributes':['id'],'raw':!![]})['then'](function(_0x5390af){const _0x371be9=_0x39020d;return _0x44a3cb['setDataValue'](_0x371be9('0x7'),_0x5390af['map'](function(_0x3fdd1f){return{'id':_0x3fdd1f['id']};})),OpenchannelMessage[_0x371be9('0x3')]({'where':{'OpenchannelInteractionId':_0x44a3cb['id'],'direction':'in','read':![]},'raw':!![]});})[_0x39020d('0x5')](function(_0x3e0ab0){const _0x190e2d=_0x39020d;_0x44a3cb[_0x190e2d('0xa')](_0x190e2d('0xb'),_0x3e0ab0[_0x190e2d('0x2')]),OpenchannelInteractionEvents[_0x190e2d('0x8')](_0x17bcbf+':'+_0x44a3cb['id'],_0x44a3cb),OpenchannelInteractionEvents[_0x190e2d('0x8')](_0x17bcbf,_0x44a3cb);})['catch'](()=>{});};}for(const e in events){if(typeof events[e]!=='undefined'){const event=events[e];OpenchannelInteraction[_0x299848('0x0')](e,emitEvent(event));}}module[_0x299848('0x1')]=OpenchannelInteractionEvents;
\ No newline at end of file
+const a481_0x39fd=['findAll','getUsers','addHook','OpenchannelInteraction','unreadMessages','../../mysqldb','exports','length','undefined','remove','OpenchannelMessage','then','setDataValue','emit'];(function(_0xea8dd7,_0x39fd98){const _0x205c60=function(_0x4b0180){while(--_0x4b0180){_0xea8dd7['push'](_0xea8dd7['shift']());}};_0x205c60(++_0x39fd98);}(a481_0x39fd,0x96));const a481_0x205c=function(_0xea8dd7,_0x39fd98){_0xea8dd7=_0xea8dd7-0x0;let _0x205c60=a481_0x39fd[_0xea8dd7];return _0x205c60;};const _0x1c6d94=a481_0x205c;'use strict';const EventEmitter=require('events'),OpenchannelInteraction=require('../../mysqldb')['db'][_0x1c6d94('0x7')],OpenchannelMessage=require(_0x1c6d94('0x9'))['db'][_0x1c6d94('0x0')],OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);const events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x1c6d94('0xd')};function emitEvent(_0x4b0180){return function(_0x160905){const _0x279def=a481_0x205c;_0x160905[_0x279def('0x5')]({'attributes':['id'],'raw':!![]})[_0x279def('0x1')](function(_0x2f500c){const _0x24f332=_0x279def;return _0x160905['setDataValue']('Users',_0x2f500c['map'](function(_0x19410a){return{'id':_0x19410a['id']};})),OpenchannelMessage[_0x24f332('0x4')]({'where':{'OpenchannelInteractionId':_0x160905['id'],'direction':'in','read':![]},'raw':!![]});})[_0x279def('0x1')](function(_0x5a39c2){const _0x4d7512=_0x279def;_0x160905[_0x4d7512('0x2')](_0x4d7512('0x8'),_0x5a39c2[_0x4d7512('0xb')]),OpenchannelInteractionEvents['emit'](_0x4b0180+':'+_0x160905['id'],_0x160905),OpenchannelInteractionEvents[_0x4d7512('0x3')](_0x4b0180,_0x160905);})['catch'](()=>{});};}for(const e in events){if(typeof events[e]!==_0x1c6d94('0xc')){const event=events[e];OpenchannelInteraction[_0x1c6d94('0x6')](e,emitEvent(event));}}module[_0x1c6d94('0xa')]=OpenchannelInteractionEvents;
\ No newline at end of file