81bb61c0a466d2a0fe8dd06aad28c386dce28368
[motion.git] / server / api / chat_room / chat_room.controller.js
1 var _0xb077=["\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","\x74\x6F\x2D\x63\x73\x76","\x75\x74\x69\x6C","\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","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x55\x73\x65\x72","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x43\x68\x61\x74\x52\x6F\x6F\x6D","\x43\x68\x61\x74\x4D\x65\x73\x73\x61\x67\x65","\x43\x68\x61\x74\x57\x65\x62\x73\x69\x74\x65","\x43\x68\x61\x74\x41\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E","\x43\x68\x61\x74\x51\x75\x65\x75\x65","\x43\x68\x61\x74\x56\x69\x73\x69\x74\x6F\x72","\x4C\x69\x73\x74","\x55\x73\x65\x72\x48\x61\x73\x43\x68\x61\x74\x52\x6F\x6F\x6D","\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","\x69\x64","\x6E\x61\x6D\x65","\x66\x75\x6C\x6C\x6E\x61\x6D\x65","\x65\x6D\x61\x69\x6C","\x72\x6F\x6C\x65","\x69\x6E\x74\x65\x72\x6E\x61\x6C","\x6D\x65\x72\x67\x65","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x64\x65\x73\x63\x72\x69\x62\x65","\x6D\x61\x70","\x67\x65\x74\x43\x68\x61\x74\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x66\x69\x6E\x64\x42\x79\x49\x64","\x75\x73\x65\x72","\x75\x6E\x6D\x61\x6E\x61\x67\x65\x64","\x55\x4E\x4D\x41\x4E\x41\x47\x45\x44","\x64\x61\x79","\x73\x74\x61\x72\x74\x4F\x66","\x63\x6F\x75\x6E\x74","\x61\x6C\x6C","\x75\x70\x64\x61\x74\x65\x50\x61\x74\x63\x68","\x74\x61\x67\x73","\x62\x6F\x64\x79","\x2C","\x73\x70\x6C\x69\x74","\x70\x61\x72\x61\x6D\x73","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x75\x70\x64\x61\x74\x65","\x24\x61\x6E\x64","\x69\x73\x41\x72\x72\x61\x79","\x6C\x65\x6E\x67\x74\x68","\x25","\x3B\x25","\x70\x75\x73\x68","\x67\x65\x74\x41\x67\x65\x6E\x74\x73","\x67\x65\x74\x41\x67\x65\x6E\x74\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x73\x63\x6F\x70\x65","\x67\x65\x74\x47\x72\x6F\x75\x70\x73","\x67\x72\x6F\x75\x70","\x61\x67\x65\x6E\x74","\x75\x73\x65\x72\x70\x69\x63","\x66\x69\x6E\x64\x41\x6C\x6C","\x67\x65\x74\x45\x78\x74\x65\x72\x6E\x61\x6C\x73","\x65\x78\x74\x65\x72\x6E\x61\x6C","\x69\x6E\x63\x6C\x75\x64\x65","\x67\x65\x74\x41\x67\x65\x6E\x74","\x67\x65\x74\x4F\x6E\x6C\x69\x6E\x65\x52\x6F\x6F\x6D","\x6F\x6E\x6C\x69\x6E\x65","\x6D\x65","\x67\x65\x74\x43\x68\x61\x74\x52\x6F\x6F\x6D\x73","\x73\x68\x6F\x77","\x61\x64\x64\x72\x65\x73\x73","\x67\x65\x74\x52\x6F\x6F\x6D\x42\x79\x55\x73\x65\x72\x73","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x67\x65\x74\x55\x73\x65\x72\x73","\x75\x73\x65\x72\x73","\x73\x65\x74\x55\x73\x65\x72\x73","\x73\x70\x72\x65\x61\x64","\x62\x61\x73\x65\x36\x34","\x73\x6F\x72\x74","\x73\x74\x72\x69\x6E\x67\x69\x66\x79","\x4F\x50\x45\x4E","\x66\x69\x6E\x64\x4F\x72\x43\x72\x65\x61\x74\x65","\x63\x72\x65\x61\x74\x65\x4D\x65\x73\x73\x61\x67\x65","\x74\x79\x70\x65","\x63\x72\x65\x61\x74\x65","\x65\x78\x70\x6F\x72\x74","\x20","\x72\x65\x70\x6C\x61\x63\x65","\x63\x72\x65\x61\x74\x65\x64\x41\x74","\x66\x6F\x72\x45\x61\x63\x68","\x43\x68\x61\x74\x4D\x65\x73\x73\x61\x67\x65\x73","\x74\x65\x78\x74\x2F\x63\x73\x76","\x67\x65\x74\x52\x6F\x6F\x6D\x42\x79\x54\x79\x70\x65","\x67\x65\x74\x52\x6F\x6F\x6D\x47\x72\x6F\x75\x70\x73","\x75\x70\x64\x61\x74\x65\x55\x73\x65\x72\x73","\x64\x65\x73\x74\x72\x6F\x79","\x73\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72"];_0xb077[0];var _=require(_0xb077[1]);var md5=require(_0xb077[2]);var moment=require(_0xb077[3]);var csv=require(_0xb077[4]);var util=require(_0xb077[5]);var logger=require(_0xb077[7])(_0xb077[6]);var Util=require(_0xb077[8]);var User=require(_0xb077[10])[_0xb077[9]];var Agent=require(_0xb077[10])[_0xb077[9]];var ChatRoom=require(_0xb077[10])[_0xb077[11]];var ChatMessage=require(_0xb077[10])[_0xb077[12]];var ChatWebsite=require(_0xb077[10])[_0xb077[13]];var ChatApplication=require(_0xb077[10])[_0xb077[14]];var ChatQueue=require(_0xb077[10])[_0xb077[15]];var ChatVisitor=require(_0xb077[10])[_0xb077[16]];var List=require(_0xb077[10])[_0xb077[17]];var UserHasChatRoom=require(_0xb077[10])[_0xb077[18]];exports[_0xb077[19]]= function(_0xefe9x12,_0xefe9x13,_0xefe9x14){return ChatRoom[_0xb077[33]](_[_0xb077[32]](Util[_0xb077[25]](_0xefe9x12[_0xb077[24]]),{include:[{model:User,attributes:[_0xb077[26],_0xb077[27],_0xb077[28],_0xb077[29],_0xb077[30],_0xb077[31]]},{model:ChatMessage},{model:ChatVisitor}]}))[_0xb077[23]](function(_0xefe9x16){_0xefe9x13[_0xb077[22]](200)[_0xb077[21]](_0xefe9x16)})[_0xb077[20]](function(_0xefe9x15){return handleError(_0xefe9x13,_0xefe9x15)})};exports[_0xb077[34]]= function(_0xefe9x12,_0xefe9x13){return ChatRoom[_0xb077[34]]()[_0xb077[23]](function(_0xefe9x17){return _0xefe9x13[_0xb077[22]](200)[_0xb077[21]](_0xefe9x17)})[_0xb077[20]](function(_0xefe9x15){return handleError(_0xefe9x13,_0xefe9x15)})};function getChatQueues(_0xefe9x19){return function(){switch(_0xefe9x19[_0xb077[30]]){case _0xb077[38]:return User[_0xb077[37]](_0xefe9x19[_0xb077[26]],{attributes:[_0xb077[26]]})[_0xb077[23]](Util[_0xb077[36]]({},{attributes:[_0xb077[26]]}))[_0xb077[23]](function(_0xefe9x1a){return {include:{model:ChatWebsite,include:{model:ChatApplication,include:{model:ChatQueue,where:{id:_[_0xb077[35]](_0xefe9x1a,_0xb077[26])}}}}}});default:return {}}}}exports[_0xb077[39]]= function(_0xefe9x12,_0xefe9x13){return Promise[_0xb077[44]]([])[_0xb077[23]](getChatQueues(_0xefe9x12[_0xb077[38]]))[_0xb077[23]](function(_0xefe9x1c){return ChatRoom[_0xb077[43]](_[_0xb077[32]](Util[_0xb077[25]](_0xefe9x12[_0xb077[24]],{status:_0xb077[40],updatedAt:{$gte:moment()[_0xb077[42]](_0xb077[41])}}),_0xefe9x1c))})[_0xb077[23]](function(_0xefe9x1b){return _0xefe9x13[_0xb077[22]](200)[_0xb077[21]]({value:_0xefe9x1b})})[_0xb077[20]](function(_0xefe9x15){return handleError(_0xefe9x13,_0xefe9x15)})};exports[_0xb077[45]]= function(_0xefe9x12,_0xefe9x13,_0xefe9x14){var _0xefe9x1d={tags:_0xefe9x12[_0xb077[47]][_0xb077[46]]};var _0xefe9x1e={where:{id:_0xefe9x12[_0xb077[50]][_0xb077[26]][_0xb077[49]](_0xb077[48])}};return ChatRoom[_0xb077[52]](_0xefe9x1d,_0xefe9x1e)[_0xb077[23]](function(_0xefe9x1f){if(!_0xefe9x1f){return _0xefe9x13[_0xb077[51]](404)};return _0xefe9x1f})[_0xb077[23]](function(_0xefe9x1f){return _0xefe9x13[_0xb077[51]](200)})[_0xb077[20]](function(_0xefe9x15){return handleError(_0xefe9x13,_0xefe9x15)})};function checkTags(_0xefe9x21){if(_0xefe9x21){if(_0xefe9x21[_0xb077[46]]){_0xefe9x21[_0xb077[53]]= [];if(_[_0xb077[54]](_0xefe9x21[_0xb077[46]])){for(var _0xefe9x22=0;_0xefe9x22< _0xefe9x21[_0xb077[46]][_0xb077[55]];_0xefe9x22++){_0xefe9x21[_0xb077[53]][_0xb077[58]]({tags:{$like:_0xb077[56]+ _0xefe9x21[_0xb077[46]][_0xefe9x22]+ _0xb077[57]}})}}else {_0xefe9x21[_0xb077[53]][_0xb077[58]]({tags:{$like:_0xb077[56]+ _0xefe9x21[_0xb077[46]]+ _0xb077[57]}})};delete _0xefe9x21[_0xb077[46]]}}}exports[_0xb077[59]]= function(_0xefe9x12,_0xefe9x13,_0xefe9x14){switch(_0xefe9x12[_0xb077[38]][_0xb077[30]]){case _0xb077[38]:return User[_0xb077[37]](_0xefe9x12[_0xb077[38]][_0xb077[26]],{attributes:[_0xb077[26]],where:{id:{$ne:_0xefe9x12[_0xb077[38]][_0xb077[26]]},online:true}})[_0xb077[23]](Util[_0xb077[60]](_[_0xb077[32]](_0xefe9x12[_0xb077[24]],{id:{$ne:_0xefe9x12[_0xb077[38]][_0xb077[26]]}})))[_0xb077[23]](function(_0xefe9x16){return _0xefe9x13[_0xb077[22]](200)[_0xb077[21]](_0xefe9x16)})[_0xb077[20]](function(_0xefe9x15){return handleError(_0xefe9x13,_0xefe9x15)});default:return User[_0xb077[61]](_0xb077[44])[_0xb077[33]](_[_0xb077[32]](Util[_0xb077[25]](_0xefe9x12[_0xb077[24]]),{where:{id:{$ne:_0xefe9x12[_0xb077[38]][_0xb077[26]]},online:true}}))[_0xb077[23]](function(_0xefe9x16){return _0xefe9x13[_0xb077[22]](200)[_0xb077[21]](_0xefe9x16)})[_0xb077[20]](function(_0xefe9x15){return handleError(_0xefe9x13,_0xefe9x15)})}};exports[_0xb077[62]]= function(_0xefe9x12,_0xefe9x13,_0xefe9x14){checkTags(_0xefe9x12[_0xb077[24]]);var _0xefe9x23={where:_[_0xb077[32]]({type:_0xb077[63]},_0xefe9x12[_0xb077[24]])};switch(_0xefe9x12[_0xb077[38]][_0xb077[30]]){case _0xb077[64]:_[_0xb077[32]](_0xefe9x23,{include:[{model:User,attributes:[_0xb077[26]],where:{id:_0xefe9x12[_0xb077[38]][_0xb077[26]]}}]});break;default:};return ChatRoom[_0xb077[66]](_0xefe9x23)[_0xb077[23]](function(_0xefe9x1f){return ChatRoom[_0xb077[66]]({where:{id:{$in:_[_0xb077[35]](_0xefe9x1f,_0xb077[26])}},include:[{model:User,attributes:[_0xb077[26],_0xb077[27],_0xb077[28],_0xb077[30],_0xb077[65]]},{model:ChatVisitor}]})})[_0xb077[23]](function(_0xefe9x1f){return _0xefe9x13[_0xb077[22]](200)[_0xb077[21]]({rows:_0xefe9x1f,count:_0xefe9x1f[_0xb077[55]]})})[_0xb077[20]](function(_0xefe9x15){return handleError(_0xefe9x13,_0xefe9x15)})};exports[_0xb077[67]]= function(_0xefe9x12,_0xefe9x13,_0xefe9x14){checkTags(_0xefe9x12[_0xb077[24]]);var _0xefe9x23={where:_[_0xb077[32]]({type:_0xb077[68]},_0xefe9x12[_0xb077[24]]),include:[{model:ChatVisitor,attributes:[_0xb077[26],_0xb077[28]]}]};switch(_0xefe9x12[_0xb077[38]][_0xb077[30]]){case _0xb077[64]:_0xefe9x23[_0xb077[69]][_0xb077[58]]({model:User,attributes:[_0xb077[26]],where:{id:_0xefe9x12[_0xb077[38]][_0xb077[26]]}});break;default:};return ChatRoom[_0xb077[66]](_0xefe9x23)[_0xb077[23]](function(_0xefe9x1f){return _0xefe9x13[_0xb077[22]](200)[_0xb077[21]]({rows:_0xefe9x1f,count:_0xefe9x1f[_0xb077[55]]})})[_0xb077[20]](function(_0xefe9x15){return handleError(_0xefe9x13,_0xefe9x15)})};exports[_0xb077[70]]= function(_0xefe9x12,_0xefe9x13,_0xefe9x14){return User[_0xb077[61]](_0xb077[44])[_0xb077[37]](_0xefe9x12[_0xb077[50]][_0xb077[26]])[_0xb077[23]](function(_0xefe9x16){return _0xefe9x13[_0xb077[22]](200)[_0xb077[21]](_0xefe9x16)})[_0xb077[20]](function(_0xefe9x15){return handleError(_0xefe9x13,_0xefe9x15)})};exports[_0xb077[71]]= function(_0xefe9x12,_0xefe9x13,_0xefe9x14){return ChatRoom[_0xb077[61]](_0xb077[72])[_0xb077[33]](_[_0xb077[32]](Util[_0xb077[25]](_0xefe9x12[_0xb077[24]]),{include:[{model:User,attributes:[_0xb077[26],_0xb077[27],_0xb077[28],_0xb077[29],_0xb077[30],_0xb077[31]]},{model:ChatMessage},{model:ChatVisitor}]}))[_0xb077[23]](function(_0xefe9x16){_0xefe9x13[_0xb077[22]](200)[_0xb077[21]](_0xefe9x16)})[_0xb077[20]](function(_0xefe9x15){return handleError(_0xefe9x13,_0xefe9x15)})};exports[_0xb077[73]]= function(_0xefe9x12,_0xefe9x13){return User[_0xb077[37]](_0xefe9x12[_0xb077[38]][_0xb077[26]])[_0xb077[23]](function(_0xefe9x19){return _0xefe9x19[_0xb077[74]]({include:[{model:ChatVisitor,attributes:[_0xb077[26],_0xb077[28],_0xb077[29]]},{model:User,attributes:[_0xb077[26],_0xb077[27],_0xb077[28],_0xb077[29],_0xb077[30],_0xb077[31]]}]})})[_0xb077[23]](function(_0xefe9x1f){if(!_0xefe9x1f){return _0xefe9x13[_0xb077[51]](404)};return _0xefe9x13[_0xb077[21]](_0xefe9x1f)})[_0xb077[20]](function(_0xefe9x15){return handleError(_0xefe9x13,_0xefe9x15)})};exports[_0xb077[75]]= function(_0xefe9x12,_0xefe9x13){return ChatRoom[_0xb077[37]](_0xefe9x12[_0xb077[50]][_0xb077[26]],{include:[{model:ChatMessage,include:[{model:ChatVisitor,attributes:[_0xb077[26],_0xb077[29],_0xb077[28]]},{model:User,attributes:[_0xb077[26],_0xb077[29],_0xb077[27],_0xb077[28],_0xb077[65],_0xb077[30],_0xb077[31]]}]},{model:User,attributes:[_0xb077[26],_0xb077[29],_0xb077[27],_0xb077[28],_0xb077[65],_0xb077[30],_0xb077[31]]},{model:ChatVisitor},{model:ChatWebsite,attributes:[_0xb077[26],_0xb077[27],_0xb077[76]],include:[List]}],order:[[ChatMessage,_0xb077[26]]]})[_0xb077[23]](function(_0xefe9x24){if(!_0xefe9x24){return _0xefe9x13[_0xb077[51]](404)};return _0xefe9x13[_0xb077[21]](_0xefe9x24)})[_0xb077[20]](function(_0xefe9x15){return handleError(_0xefe9x13,_0xefe9x15)})};exports[_0xb077[77]]= function(_0xefe9x12,_0xefe9x13,_0xefe9x14){var _0xefe9x25;return ChatRoom[_0xb077[87]]({where:{token:md5(JSON[_0xb077[85]](_0xefe9x12[_0xb077[24]][_0xb077[80]][_0xb077[84]]())).toString(_0xb077[83])},defaults:{type:_0xb077[31],token:md5(JSON[_0xb077[85]](_0xefe9x12[_0xb077[24]][_0xb077[80]][_0xb077[84]]())).toString(_0xb077[83]),status:_0xb077[86]},include:[{model:ChatMessage,include:[{model:ChatVisitor,attributes:[_0xb077[26],_0xb077[29],_0xb077[28]]},{model:User,attributes:[_0xb077[26],_0xb077[27],_0xb077[28],_0xb077[29],_0xb077[30],_0xb077[31]]}]},{model:User,attributes:[_0xb077[26],_0xb077[27],_0xb077[28],_0xb077[29],_0xb077[30],_0xb077[31]]}]})[_0xb077[82]](function(_0xefe9x24,_0xefe9x27){_0xefe9x25= _0xefe9x24;if(_0xefe9x27){return _0xefe9x25[_0xb077[81]](_0xefe9x12[_0xb077[24]][_0xb077[80]])}})[_0xb077[23]](function(){return _0xefe9x25[_0xb077[79]]()})[_0xb077[23]](function(_0xefe9x26){return _0xefe9x13[_0xb077[22]](200)[_0xb077[21]](_[_0xb077[32]](_0xefe9x25[_0xb077[78]],{Users:_0xefe9x26}))})[_0xb077[20]](function(_0xefe9x15){return handleError(_0xefe9x13,_0xefe9x15)})};exports[_0xb077[88]]= function(_0xefe9x12,_0xefe9x13,_0xefe9x14){var _0xefe9x25;return ChatRoom[_0xb077[37]](_0xefe9x12[_0xb077[50]][_0xb077[26]])[_0xb077[23]](function(_0xefe9x24){_0xefe9x25= _0xefe9x24;if(!_0xefe9x25){return _0xefe9x13[_0xb077[51]](404)}})[_0xb077[23]](function(){return ChatMessage[_0xb077[90]](_[_0xb077[32]](_0xefe9x12[_0xb077[47]],{type:_0xefe9x25[_0xb077[89]],ChatRoomId:_0xefe9x12[_0xb077[50]][_0xb077[26]],UserId:_0xefe9x12[_0xb077[38]][_0xb077[26]]}))})[_0xb077[23]](function(_0xefe9x28){return _0xefe9x13[_0xb077[22]](200)[_0xb077[21]](_0xefe9x28)})[_0xb077[20]](function(_0xefe9x15){return handleError(_0xefe9x13,_0xefe9x15)})};exports[_0xb077[91]]= function(_0xefe9x12,_0xefe9x13,_0xefe9x14){return ChatRoom[_0xb077[37]](_0xefe9x12[_0xb077[50]][_0xb077[26]],{include:[{model:ChatMessage,include:[{model:ChatVisitor,attributes:[_0xb077[26],_0xb077[28]]},{model:User,attributes:[_0xb077[26],_0xb077[28]]}]}]})[_0xb077[23]](function(_0xefe9x24){var _0xefe9x29=[];_0xefe9x24[_0xb077[96]][_0xb077[95]](function(_0xefe9x28){_0xefe9x29[_0xb077[58]]({name:_0xefe9x28[_0xb077[9]]?_0xefe9x28[_0xb077[9]][_0xb077[28]]:_0xefe9x28[_0xb077[16]][_0xb077[28]],text:_0xefe9x28[_0xb077[47]][_0xb077[93]](/(\r\n|\n|\r)/gm,_0xb077[92]),date:_0xefe9x28[_0xb077[94]]})});return _0xefe9x13[_0xb077[89]](_0xb077[97])[_0xb077[22]](200)[_0xb077[21]](csv(_0xefe9x29))})[_0xb077[20]](function(_0xefe9x15){return handleError(_0xefe9x13,_0xefe9x15)})};exports[_0xb077[98]]= function(_0xefe9x12,_0xefe9x13){return User[_0xb077[37]](_0xefe9x12[_0xb077[38]][_0xb077[26]])[_0xb077[23]](function(_0xefe9x19){return _0xefe9x19[_0xb077[74]]({where:{type:_0xefe9x12[_0xb077[50]][_0xb077[89]]},include:[{model:ChatVisitor,attributes:[_0xb077[26],_0xb077[28],_0xb077[29]]}]})})[_0xb077[23]](function(_0xefe9x1f){if(!_0xefe9x1f){return _0xefe9x13[_0xb077[51]](404)};return _0xefe9x13[_0xb077[21]](_0xefe9x1f)})[_0xb077[20]](function(_0xefe9x15){return handleError(_0xefe9x13,_0xefe9x15)})};exports[_0xb077[99]]= function(_0xefe9x12,_0xefe9x13){return User[_0xb077[37]](_0xefe9x12[_0xb077[38]][_0xb077[26]])[_0xb077[23]](function(_0xefe9x19){return _0xefe9x19[_0xb077[74]]({include:[{model:ChatVisitor,attributes:[_0xb077[26],_0xb077[28],_0xb077[29]]},{model:User,attributes:[_0xb077[26],_0xb077[27],_0xb077[28],_0xb077[29],_0xb077[30],_0xb077[31]]}]})})[_0xb077[23]](function(_0xefe9x1f){if(!_0xefe9x1f){return _0xefe9x13[_0xb077[51]](404)};return _0xefe9x13[_0xb077[21]](_0xefe9x1f)})[_0xb077[20]](function(_0xefe9x15){return handleError(_0xefe9x13,_0xefe9x15)})};exports[_0xb077[90]]= function(_0xefe9x12,_0xefe9x13){};exports[_0xb077[52]]= function(_0xefe9x12,_0xefe9x13){if(_0xefe9x12[_0xb077[47]][_0xb077[26]]){delete _0xefe9x12[_0xb077[47]][_0xb077[26]]};return ChatRoom[_0xb077[37]](_0xefe9x12[_0xb077[50]][_0xb077[26]])[_0xb077[23]](function(_0xefe9x24){if(!_0xefe9x24){return _0xefe9x13[_0xb077[51]](404)};return _0xefe9x24[_0xb077[52]](_0xefe9x12[_0xb077[47]])})[_0xb077[23]](function(_0xefe9x24){return _0xefe9x13[_0xb077[22]](200)[_0xb077[21]](_0xefe9x24)})[_0xb077[20]](function(_0xefe9x15){return handleError(_0xefe9x13,_0xefe9x15)})};exports[_0xb077[100]]= function(_0xefe9x12,_0xefe9x13){var _0xefe9x25;if(_0xefe9x12[_0xb077[47]][_0xb077[26]]){delete _0xefe9x12[_0xb077[47]][_0xb077[26]]};return ChatRoom[_0xb077[37]](_0xefe9x12[_0xb077[50]][_0xb077[26]])[_0xb077[23]](function(_0xefe9x24){if(!_0xefe9x24||  !_0xefe9x12[_0xb077[47]][_0xb077[80]]){return _0xefe9x13[_0xb077[51]](404)};return _0xefe9x24})[_0xb077[23]](function(_0xefe9x24){return _0xefe9x24[_0xb077[52]]({type:_0xb077[63],token:md5(JSON[_0xb077[85]](_0xefe9x12[_0xb077[47]][_0xb077[80]][_0xb077[84]]())).toString(_0xb077[83])})})[_0xb077[23]](function(_0xefe9x24){_0xefe9x25= _0xefe9x24;return _0xefe9x24[_0xb077[81]](_0xefe9x12[_0xb077[47]][_0xb077[80]][_0xb077[84]](),{individualHooks:true})})[_0xb077[23]](function(){return _0xefe9x25[_0xb077[79]]()})[_0xb077[23]](function(_0xefe9x26){_[_0xb077[32]](_0xefe9x25[_0xb077[78]],{Users:_0xefe9x26});return _0xefe9x13[_0xb077[22]](200)[_0xb077[21]](_0xefe9x25)})[_0xb077[20]](function(_0xefe9x15){return handleError(_0xefe9x13,_0xefe9x15)})};exports[_0xb077[101]]= function(_0xefe9x12,_0xefe9x13){return ChatRoom[_0xb077[37]](_0xefe9x12[_0xb077[50]][_0xb077[26]])[_0xb077[23]](function(_0xefe9x24){if(!_0xefe9x24){return _0xefe9x13[_0xb077[51]](404)};return _0xefe9x24[_0xb077[101]]()})[_0xb077[23]](function(){return _0xefe9x13[_0xb077[51]](204)})[_0xb077[20]](function(_0xefe9x15){return handleError(_0xefe9x13,_0xefe9x15)})};function handleError(_0xefe9x13,_0xefe9x15){logger[_0xb077[103]](_0xefe9x15[_0xb077[102]]);return _0xefe9x13[_0xb077[22]](500)[_0xb077[21]](_0xefe9x15)}