59613cf7739fc06a0f2b2b77fa964ffb545fb22d
[motion.git] / server / api / report_openchannel_session / report_openchannel_session.socket.js
1 var _0x50be=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x52\x65\x70\x6F\x72\x74\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x53\x65\x73\x73\x69\x6F\x6E","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x55\x73\x65\x72","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x6C\x6F\x64\x61\x73\x68","\x62\x6C\x75\x65\x62\x69\x72\x64","\x72\x65\x67\x69\x73\x74\x65\x72","\x61\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65","\x61\x66\x74\x65\x72\x55\x70\x64\x61\x74\x65","\x61\x66\x74\x65\x72\x44\x65\x73\x74\x72\x6F\x79","\x69\x64","\x6D\x61\x70","\x75\x6E\x69\x6F\x6E","\x66\x6F\x72\x45\x61\x63\x68","\x72\x6F\x77\x73","\x74\x68\x65\x6E","\x67\x65\x74\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x75\x73\x65\x72\x49\x64","\x66\x69\x6E\x64\x42\x79\x49\x64","\x75\x73\x65\x72","\x67\x65\x74\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x51\x75\x65\x75\x65\x73","\x61\x67\x65\x6E\x74","\x72\x6F\x6C\x65","\x45\x72\x72\x6F\x72\x20\x66\x69\x6C\x74\x65\x72\x69\x6E\x67\x20\x72\x65\x70\x6F\x72\x74\x20\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x20\x73\x65\x73\x73\x69\x6F\x6E\x73\x20\x61\x66\x74\x65\x72\x20\x73\x61\x76\x65","\x6C\x6F\x67","\x63\x61\x74\x63\x68","\x61\x64\x6D\x69\x6E","\x6D\x65\x6D\x62\x65\x72\x69\x64","\x69\x6E\x63\x6C\x75\x64\x65\x73","\x71\x75\x65\x75\x65","\x72\x65\x70\x6F\x72\x74\x5F\x6F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x5F\x73\x65\x73\x73\x69\x6F\x6E\x3A\x73\x61\x76\x65","\x65\x6D\x69\x74","\x61\x6C\x6C","\x72\x65\x70\x6F\x72\x74\x5F\x6F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x5F\x73\x65\x73\x73\x69\x6F\x6E\x3A\x72\x65\x6D\x6F\x76\x65"];_0x50be[0];var ReportOpenchannelSession=require(_0x50be[2])[_0x50be[1]];var User=require(_0x50be[2])[_0x50be[3]];var Util=require(_0x50be[4]);var _=require(_0x50be[5]);var Promise=require(_0x50be[6]);exports[_0x50be[7]]= function(_0x20b4x6){ReportOpenchannelSession[_0x50be[8]](function(_0x20b4x7){onSave(_0x20b4x6,_0x20b4x7)});ReportOpenchannelSession[_0x50be[9]](function(_0x20b4x7){onSave(_0x20b4x6,_0x20b4x7)});ReportOpenchannelSession[_0x50be[10]](function(_0x20b4x7){onRemove(_0x20b4x6,_0x20b4x7)})};function getOpenchannelQueues(_0x20b4x9){return function(){switch(_0x20b4x9[_0x50be[23]]){case _0x50be[20]:return User[_0x50be[19]](_0x20b4x9[_0x50be[18]],{attributes:[_0x50be[11]]})[_0x50be[16]](Util[_0x50be[17]]({},{attributes:[_0x50be[11]],include:[{raw:true,model:User,attributes:[_0x50be[11]]}]}))[_0x50be[16]](function(_0x20b4xa){var _0x20b4xb=[];_0x20b4xa[_0x50be[15]][_0x50be[14]](function(_0x20b4xc){_0x20b4xb= _[_0x50be[13]](_0x20b4xb,_[_0x50be[12]](_0x20b4xc.Users,_0x50be[11]))});return {queue:_[_0x50be[12]](_0x20b4xa[_0x50be[15]],_0x50be[11]),memberid:_0x20b4xb}});case _0x50be[22]:return User[_0x50be[19]](_0x20b4x9[_0x50be[18]],{attributes:[_0x50be[11]]})[_0x50be[16]](function(_0x20b4xd){return _0x20b4xd[_0x50be[21]]({attributes:[_0x50be[11]]})})[_0x50be[16]](function(_0x20b4xa){return {queue:_[_0x50be[12]](_0x20b4xa,_0x50be[11]),memberid:_0x20b4x9[_0x50be[18]]}});default:return {}}}}function onSave(_0x20b4x6,_0x20b4x7,_0x20b4xf){return Promise[_0x50be[33]]([])[_0x50be[16]](getOpenchannelQueues(_0x20b4x6))[_0x50be[16]](function(_0x20b4x11){if(_0x20b4x6[_0x50be[23]]=== _0x50be[27]|| _[_0x50be[29]](_0x20b4x11[_0x50be[28]],_0x20b4x7[_0x50be[28]])|| _[_0x50be[29]](_0x20b4x11[_0x50be[30]],_0x20b4x7[_0x50be[30]])){_0x20b4x6[_0x50be[32]](_0x50be[31],_0x20b4x7)}})[_0x50be[26]](function(_0x20b4x10){console[_0x50be[25]](_0x50be[24],_0x20b4x10)})}function onRemove(_0x20b4x6,_0x20b4x7,_0x20b4xf){_0x20b4x6[_0x50be[32]](_0x50be[34],_0x20b4x7)}