Built motion from commit 15a6d846f.|1.0.20
[motion.git] / server / api / report_chat / report_chat.controller.js
1 var _0x7f39=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x6D\x64\x35","\x6D\x6F\x6D\x65\x6E\x74","\x61\x70\x69","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\x52\x65\x70\x6F\x72\x74\x43\x68\x61\x74","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x43\x68\x61\x74\x52\x6F\x6F\x6D","\x43\x68\x61\x74\x56\x69\x73\x69\x74\x6F\x72","\x55\x73\x65\x72","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x69\x6E\x64\x65\x78","\x63\x61\x74\x63\x68","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x74\x68\x65\x6E","\x71\x75\x65\x72\x79","\x67\x65\x74\x51\x75\x65\x72\x79","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x61\x63\x63\x65\x70\x74","\x2E","\x73\x70\x6C\x69\x74","\x75\x6E\x69\x71\x75\x65\x69\x64","\x70\x61\x72\x61\x6D\x73","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x61\x63\x63\x65\x70\x74\x65\x64","\x6D\x65\x72\x67\x65","\x73\x61\x76\x65","\x66\x69\x6E\x64\x42\x79\x49\x64","\x62\x61\x73\x65\x36\x34","\x69\x64","\x75\x73\x65\x72","\x73\x74\x72\x69\x6E\x67\x69\x66\x79","\x4F\x50\x45\x4E","\x75\x70\x64\x61\x74\x65","\x61\x64\x64\x55\x73\x65\x72","\x63\x72\x65\x61\x74\x65","\x62\x6F\x64\x79","\x64\x65\x73\x74\x72\x6F\x79","\x72\x65\x6A\x65\x63\x74","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x66\x6F\x72\x6D\x61\x74","\x73\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72"];_0x7f39[0];var _=require(_0x7f39[1]);var md5=require(_0x7f39[2]);var moment=require(_0x7f39[3]);var logger=require(_0x7f39[5])(_0x7f39[4]);var ReportChat=require(_0x7f39[7])[_0x7f39[6]];var ChatRoom=require(_0x7f39[7])[_0x7f39[8]];var ChatVisitor=require(_0x7f39[7])[_0x7f39[9]];var Agent=require(_0x7f39[7])[_0x7f39[10]];var sequelize=require(_0x7f39[7])[_0x7f39[11]];var Util=require(_0x7f39[12]);exports[_0x7f39[13]]= function(_0x5580xb,_0x5580xc,_0x5580xd){return ReportChat[_0x7f39[20]](Util[_0x7f39[19]](_0x5580xb[_0x7f39[18]]))[_0x7f39[17]](function(_0x5580xf){_0x5580xc[_0x7f39[16]](200)[_0x7f39[15]](_0x5580xf)})[_0x7f39[14]](function(_0x5580xe){return handleError(_0x5580xc,_0x5580xe)})};exports[_0x7f39[21]]= function(_0x5580xb,_0x5580xc){var _0x5580x10=_0x5580xb[_0x7f39[25]][_0x7f39[24]][_0x7f39[23]](_0x7f39[22])[1];var _0x5580x11;return ReportChat[_0x7f39[30]](_0x5580xb[_0x7f39[25]][_0x7f39[32]])[_0x7f39[17]](function(_0x5580x15){if(!_0x5580x15){return _0x5580xc[_0x7f39[26]](404)};var _0x5580x13=_[_0x7f39[28]](_0x5580x15,{connectid:_0x5580xb[_0x7f39[25]][_0x7f39[24]]});return _0x5580x13[_0x7f39[29]]()})[_0x7f39[17]](function(){return ChatRoom[_0x7f39[30]](_0x5580x10)})[_0x7f39[17]](function(_0x5580x14){_0x5580x11= _0x5580x14;return _0x5580x11[_0x7f39[37]](_0x5580xb[_0x7f39[33]][_0x7f39[32]],{individualHooks:true})})[_0x7f39[17]](function(){return _0x5580x11[_0x7f39[36]]({token:md5(JSON[_0x7f39[34]]([_0x5580xb[_0x7f39[33]][_0x7f39[32]]])).toString(_0x7f39[31]),status:_0x7f39[35]})})[_0x7f39[17]](function(){return ChatVisitor[_0x7f39[30]](_0x5580x11.ChatVisitorId)})[_0x7f39[17]](function(_0x5580x12){if(!_0x5580x12){return _0x5580xc[_0x7f39[26]](404)};var _0x5580x13=_[_0x7f39[28]](_0x5580x12,{status:_0x7f39[27]});return _0x5580x13[_0x7f39[29]]()})[_0x7f39[17]](function(){return _0x5580xc[_0x7f39[26]](200)})[_0x7f39[14]](sequelize.UniqueConstraintError,function(_0x5580xe){return _0x5580xc[_0x7f39[26]](504)})[_0x7f39[14]](function(_0x5580xe){return handleError(_0x5580xc,_0x5580xe)})};exports[_0x7f39[38]]= function(_0x5580xb,_0x5580xc){return ReportChat[_0x7f39[38]](_0x5580xb[_0x7f39[39]])[_0x7f39[17]](function(_0x5580x15){return _0x5580xc[_0x7f39[16]](201)[_0x7f39[15]](_0x5580x15)})[_0x7f39[14]](function(_0x5580xe){return handleError(_0x5580xc,_0x5580xe)})};exports[_0x7f39[36]]= function(_0x5580xb,_0x5580xc,_0x5580xd){if(_0x5580xb[_0x7f39[39]][_0x7f39[32]]){delete _0x5580xb[_0x7f39[39]][_0x7f39[32]]};return ReportChat[_0x7f39[30]](_0x5580xb[_0x7f39[25]][_0x7f39[32]])[_0x7f39[17]](function(_0x5580x15){if(!_0x5580x15){return _0x5580xc[_0x7f39[26]](404)};var _0x5580x13=_[_0x7f39[28]](_0x5580x15,_0x5580xb[_0x7f39[39]]);return _0x5580x13[_0x7f39[29]]()})[_0x7f39[17]](function(_0x5580x15){return _0x5580xc[_0x7f39[16]](200)[_0x7f39[15]](_0x5580x15)})[_0x7f39[14]](sequelize.ValidationError,function(_0x5580xe){return handleError(_0x5580xc,_0x5580xe)})[_0x7f39[14]](function(_0x5580xe){return handleError(_0x5580xc,_0x5580xe)})};exports[_0x7f39[40]]= function(_0x5580xb,_0x5580xc){return ReportChat[_0x7f39[30]](_0x5580xb[_0x7f39[25]][_0x7f39[32]])[_0x7f39[17]](function(_0x5580x15){if(!_0x5580x15){return _0x5580xc[_0x7f39[26]](404)};return _0x5580x15[_0x7f39[40]]()})[_0x7f39[17]](function(){return _0x5580xc[_0x7f39[26]](204)})[_0x7f39[14]](function(_0x5580xe){return handleError(_0x5580xc,_0x5580xe)})};exports[_0x7f39[41]]= function(_0x5580xb,_0x5580xc){return ReportChat[_0x7f39[30]](_0x5580xb[_0x7f39[25]][_0x7f39[32]])[_0x7f39[17]](function(_0x5580x15){if(!_0x5580x15){return _0x5580xc[_0x7f39[26]](404)};var _0x5580x13=_[_0x7f39[28]](_0x5580x15,{rejectedAt:moment()[_0x7f39[43]](_0x7f39[42])});return _0x5580x13[_0x7f39[29]]()})[_0x7f39[17]](function(){return _0x5580xc[_0x7f39[26]](200)})[_0x7f39[14]](function(_0x5580xe){return handleError(_0x5580xc,_0x5580xe)})};function handleError(_0x5580xc,_0x5580xe){logger[_0x7f39[45]](_0x5580xe[_0x7f39[44]]);return _0x5580xc[_0x7f39[16]](500)[_0x7f39[15]](_0x5580xe)}