Built motion from commit 0eb9c9185.|1.0.19
[motion.git] / server / api / chat_room / chat_room.controller.js
1 var _0xbcc9=["\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"];_0xbcc9[0];var _=require(_0xbcc9[1]);var md5=require(_0xbcc9[2]);var moment=require(_0xbcc9[3]);var csv=require(_0xbcc9[4]);var util=require(_0xbcc9[5]);var logger=require(_0xbcc9[7])(_0xbcc9[6]);var Util=require(_0xbcc9[8]);var User=require(_0xbcc9[10])[_0xbcc9[9]];var Agent=require(_0xbcc9[10])[_0xbcc9[9]];var ChatRoom=require(_0xbcc9[10])[_0xbcc9[11]];var ChatMessage=require(_0xbcc9[10])[_0xbcc9[12]];var ChatWebsite=require(_0xbcc9[10])[_0xbcc9[13]];var ChatApplication=require(_0xbcc9[10])[_0xbcc9[14]];var ChatQueue=require(_0xbcc9[10])[_0xbcc9[15]];var ChatVisitor=require(_0xbcc9[10])[_0xbcc9[16]];var List=require(_0xbcc9[10])[_0xbcc9[17]];var UserHasChatRoom=require(_0xbcc9[10])[_0xbcc9[18]];exports[_0xbcc9[19]]= function(_0x60c1x12,_0x60c1x13,_0x60c1x14){return ChatRoom[_0xbcc9[33]](_[_0xbcc9[32]](Util[_0xbcc9[25]](_0x60c1x12[_0xbcc9[24]]),{include:[{model:User,attributes:[_0xbcc9[26],_0xbcc9[27],_0xbcc9[28],_0xbcc9[29],_0xbcc9[30],_0xbcc9[31]]},{model:ChatMessage},{model:ChatVisitor}]}))[_0xbcc9[23]](function(_0x60c1x16){_0x60c1x13[_0xbcc9[22]](200)[_0xbcc9[21]](_0x60c1x16)})[_0xbcc9[20]](function(_0x60c1x15){return handleError(_0x60c1x13,_0x60c1x15)})};exports[_0xbcc9[34]]= function(_0x60c1x12,_0x60c1x13){return ChatRoom[_0xbcc9[34]]()[_0xbcc9[23]](function(_0x60c1x17){return _0x60c1x13[_0xbcc9[22]](200)[_0xbcc9[21]](_0x60c1x17)})[_0xbcc9[20]](function(_0x60c1x15){return handleError(_0x60c1x13,_0x60c1x15)})};function getChatQueues(_0x60c1x19){return function(){switch(_0x60c1x19[_0xbcc9[30]]){case _0xbcc9[38]:return User[_0xbcc9[37]](_0x60c1x19[_0xbcc9[26]],{attributes:[_0xbcc9[26]]})[_0xbcc9[23]](Util[_0xbcc9[36]]({},{attributes:[_0xbcc9[26]]}))[_0xbcc9[23]](function(_0x60c1x1a){return {include:{model:ChatWebsite,include:{model:ChatApplication,include:{model:ChatQueue,where:{id:_[_0xbcc9[35]](_0x60c1x1a,_0xbcc9[26])}}}}}});default:return {}}}}exports[_0xbcc9[39]]= function(_0x60c1x12,_0x60c1x13){return Promise[_0xbcc9[44]]([])[_0xbcc9[23]](getChatQueues(_0x60c1x12[_0xbcc9[38]]))[_0xbcc9[23]](function(_0x60c1x1c){return ChatRoom[_0xbcc9[43]](_[_0xbcc9[32]](Util[_0xbcc9[25]](_0x60c1x12[_0xbcc9[24]],{status:_0xbcc9[40],updatedAt:{$gte:moment()[_0xbcc9[42]](_0xbcc9[41])}}),_0x60c1x1c))})[_0xbcc9[23]](function(_0x60c1x1b){return _0x60c1x13[_0xbcc9[22]](200)[_0xbcc9[21]]({value:_0x60c1x1b})})[_0xbcc9[20]](function(_0x60c1x15){return handleError(_0x60c1x13,_0x60c1x15)})};exports[_0xbcc9[45]]= function(_0x60c1x12,_0x60c1x13,_0x60c1x14){var _0x60c1x1d={tags:_0x60c1x12[_0xbcc9[47]][_0xbcc9[46]]};var _0x60c1x1e={where:{id:_0x60c1x12[_0xbcc9[50]][_0xbcc9[26]][_0xbcc9[49]](_0xbcc9[48])}};return ChatRoom[_0xbcc9[52]](_0x60c1x1d,_0x60c1x1e)[_0xbcc9[23]](function(_0x60c1x1f){if(!_0x60c1x1f){return _0x60c1x13[_0xbcc9[51]](404)};return _0x60c1x1f})[_0xbcc9[23]](function(_0x60c1x1f){return _0x60c1x13[_0xbcc9[51]](200)})[_0xbcc9[20]](function(_0x60c1x15){return handleError(_0x60c1x13,_0x60c1x15)})};function checkTags(_0x60c1x21){if(_0x60c1x21){if(_0x60c1x21[_0xbcc9[46]]){_0x60c1x21[_0xbcc9[53]]= [];if(_[_0xbcc9[54]](_0x60c1x21[_0xbcc9[46]])){for(var _0x60c1x22=0;_0x60c1x22< _0x60c1x21[_0xbcc9[46]][_0xbcc9[55]];_0x60c1x22++){_0x60c1x21[_0xbcc9[53]][_0xbcc9[58]]({tags:{$like:_0xbcc9[56]+ _0x60c1x21[_0xbcc9[46]][_0x60c1x22]+ _0xbcc9[57]}})}}else {_0x60c1x21[_0xbcc9[53]][_0xbcc9[58]]({tags:{$like:_0xbcc9[56]+ _0x60c1x21[_0xbcc9[46]]+ _0xbcc9[57]}})};delete _0x60c1x21[_0xbcc9[46]]}}}exports[_0xbcc9[59]]= function(_0x60c1x12,_0x60c1x13,_0x60c1x14){switch(_0x60c1x12[_0xbcc9[38]][_0xbcc9[30]]){case _0xbcc9[38]:return User[_0xbcc9[37]](_0x60c1x12[_0xbcc9[38]][_0xbcc9[26]],{attributes:[_0xbcc9[26]],where:{id:{$ne:_0x60c1x12[_0xbcc9[38]][_0xbcc9[26]]},online:true}})[_0xbcc9[23]](Util[_0xbcc9[60]](_[_0xbcc9[32]](_0x60c1x12[_0xbcc9[24]],{id:{$ne:_0x60c1x12[_0xbcc9[38]][_0xbcc9[26]]}})))[_0xbcc9[23]](function(_0x60c1x16){return _0x60c1x13[_0xbcc9[22]](200)[_0xbcc9[21]](_0x60c1x16)})[_0xbcc9[20]](function(_0x60c1x15){return handleError(_0x60c1x13,_0x60c1x15)});default:return User[_0xbcc9[61]](_0xbcc9[44])[_0xbcc9[33]](_[_0xbcc9[32]](Util[_0xbcc9[25]](_0x60c1x12[_0xbcc9[24]]),{where:{id:{$ne:_0x60c1x12[_0xbcc9[38]][_0xbcc9[26]]},online:true}}))[_0xbcc9[23]](function(_0x60c1x16){return _0x60c1x13[_0xbcc9[22]](200)[_0xbcc9[21]](_0x60c1x16)})[_0xbcc9[20]](function(_0x60c1x15){return handleError(_0x60c1x13,_0x60c1x15)})}};exports[_0xbcc9[62]]= function(_0x60c1x12,_0x60c1x13,_0x60c1x14){checkTags(_0x60c1x12[_0xbcc9[24]]);var _0x60c1x23={where:_[_0xbcc9[32]]({type:_0xbcc9[63]},_0x60c1x12[_0xbcc9[24]])};switch(_0x60c1x12[_0xbcc9[38]][_0xbcc9[30]]){case _0xbcc9[64]:_[_0xbcc9[32]](_0x60c1x23,{include:[{model:User,attributes:[_0xbcc9[26]],where:{id:_0x60c1x12[_0xbcc9[38]][_0xbcc9[26]]}}]});break;default:};return ChatRoom[_0xbcc9[66]](_0x60c1x23)[_0xbcc9[23]](function(_0x60c1x1f){return ChatRoom[_0xbcc9[66]]({where:{id:{$in:_[_0xbcc9[35]](_0x60c1x1f,_0xbcc9[26])}},include:[{model:User,attributes:[_0xbcc9[26],_0xbcc9[27],_0xbcc9[28],_0xbcc9[30],_0xbcc9[65]]},{model:ChatVisitor}]})})[_0xbcc9[23]](function(_0x60c1x1f){return _0x60c1x13[_0xbcc9[22]](200)[_0xbcc9[21]]({rows:_0x60c1x1f,count:_0x60c1x1f[_0xbcc9[55]]})})[_0xbcc9[20]](function(_0x60c1x15){return handleError(_0x60c1x13,_0x60c1x15)})};exports[_0xbcc9[67]]= function(_0x60c1x12,_0x60c1x13,_0x60c1x14){checkTags(_0x60c1x12[_0xbcc9[24]]);var _0x60c1x23={where:_[_0xbcc9[32]]({type:_0xbcc9[68]},_0x60c1x12[_0xbcc9[24]]),include:[{model:ChatVisitor,attributes:[_0xbcc9[26],_0xbcc9[28]]}]};switch(_0x60c1x12[_0xbcc9[38]][_0xbcc9[30]]){case _0xbcc9[64]:_0x60c1x23[_0xbcc9[69]][_0xbcc9[58]]({model:User,attributes:[_0xbcc9[26]],where:{id:_0x60c1x12[_0xbcc9[38]][_0xbcc9[26]]}});break;default:};return ChatRoom[_0xbcc9[66]](_0x60c1x23)[_0xbcc9[23]](function(_0x60c1x1f){return _0x60c1x13[_0xbcc9[22]](200)[_0xbcc9[21]]({rows:_0x60c1x1f,count:_0x60c1x1f[_0xbcc9[55]]})})[_0xbcc9[20]](function(_0x60c1x15){return handleError(_0x60c1x13,_0x60c1x15)})};exports[_0xbcc9[70]]= function(_0x60c1x12,_0x60c1x13,_0x60c1x14){return User[_0xbcc9[61]](_0xbcc9[44])[_0xbcc9[37]](_0x60c1x12[_0xbcc9[50]][_0xbcc9[26]])[_0xbcc9[23]](function(_0x60c1x16){return _0x60c1x13[_0xbcc9[22]](200)[_0xbcc9[21]](_0x60c1x16)})[_0xbcc9[20]](function(_0x60c1x15){return handleError(_0x60c1x13,_0x60c1x15)})};exports[_0xbcc9[71]]= function(_0x60c1x12,_0x60c1x13,_0x60c1x14){return ChatRoom[_0xbcc9[61]](_0xbcc9[72])[_0xbcc9[33]](_[_0xbcc9[32]](Util[_0xbcc9[25]](_0x60c1x12[_0xbcc9[24]]),{include:[{model:User,attributes:[_0xbcc9[26],_0xbcc9[27],_0xbcc9[28],_0xbcc9[29],_0xbcc9[30],_0xbcc9[31]]},{model:ChatMessage},{model:ChatVisitor}]}))[_0xbcc9[23]](function(_0x60c1x16){_0x60c1x13[_0xbcc9[22]](200)[_0xbcc9[21]](_0x60c1x16)})[_0xbcc9[20]](function(_0x60c1x15){return handleError(_0x60c1x13,_0x60c1x15)})};exports[_0xbcc9[73]]= function(_0x60c1x12,_0x60c1x13){return User[_0xbcc9[37]](_0x60c1x12[_0xbcc9[38]][_0xbcc9[26]])[_0xbcc9[23]](function(_0x60c1x19){return _0x60c1x19[_0xbcc9[74]]({include:[{model:ChatVisitor,attributes:[_0xbcc9[26],_0xbcc9[28],_0xbcc9[29]]},{model:User,attributes:[_0xbcc9[26],_0xbcc9[27],_0xbcc9[28],_0xbcc9[29],_0xbcc9[30],_0xbcc9[31]]}]})})[_0xbcc9[23]](function(_0x60c1x1f){if(!_0x60c1x1f){return _0x60c1x13[_0xbcc9[51]](404)};return _0x60c1x13[_0xbcc9[21]](_0x60c1x1f)})[_0xbcc9[20]](function(_0x60c1x15){return handleError(_0x60c1x13,_0x60c1x15)})};exports[_0xbcc9[75]]= function(_0x60c1x12,_0x60c1x13){return ChatRoom[_0xbcc9[37]](_0x60c1x12[_0xbcc9[50]][_0xbcc9[26]],{include:[{model:ChatMessage,include:[{model:ChatVisitor,attributes:[_0xbcc9[26],_0xbcc9[29],_0xbcc9[28]]},{model:User,attributes:[_0xbcc9[26],_0xbcc9[29],_0xbcc9[27],_0xbcc9[28],_0xbcc9[65],_0xbcc9[30],_0xbcc9[31]]}]},{model:User,attributes:[_0xbcc9[26],_0xbcc9[29],_0xbcc9[27],_0xbcc9[28],_0xbcc9[65],_0xbcc9[30],_0xbcc9[31]]},{model:ChatVisitor},{model:ChatWebsite,attributes:[_0xbcc9[26],_0xbcc9[27],_0xbcc9[76]],include:[List]}],order:[[ChatMessage,_0xbcc9[26]]]})[_0xbcc9[23]](function(_0x60c1x24){if(!_0x60c1x24){return _0x60c1x13[_0xbcc9[51]](404)};return _0x60c1x13[_0xbcc9[21]](_0x60c1x24)})[_0xbcc9[20]](function(_0x60c1x15){return handleError(_0x60c1x13,_0x60c1x15)})};exports[_0xbcc9[77]]= function(_0x60c1x12,_0x60c1x13,_0x60c1x14){var _0x60c1x25;return ChatRoom[_0xbcc9[87]]({where:{token:md5(JSON[_0xbcc9[85]](_0x60c1x12[_0xbcc9[24]][_0xbcc9[80]][_0xbcc9[84]]())).toString(_0xbcc9[83])},defaults:{type:_0xbcc9[31],token:md5(JSON[_0xbcc9[85]](_0x60c1x12[_0xbcc9[24]][_0xbcc9[80]][_0xbcc9[84]]())).toString(_0xbcc9[83]),status:_0xbcc9[86]},include:[{model:ChatMessage,include:[{model:ChatVisitor,attributes:[_0xbcc9[26],_0xbcc9[29],_0xbcc9[28]]},{model:User,attributes:[_0xbcc9[26],_0xbcc9[27],_0xbcc9[28],_0xbcc9[29],_0xbcc9[30],_0xbcc9[31]]}]},{model:User,attributes:[_0xbcc9[26],_0xbcc9[27],_0xbcc9[28],_0xbcc9[29],_0xbcc9[30],_0xbcc9[31]]}]})[_0xbcc9[82]](function(_0x60c1x24,_0x60c1x27){_0x60c1x25= _0x60c1x24;if(_0x60c1x27){return _0x60c1x25[_0xbcc9[81]](_0x60c1x12[_0xbcc9[24]][_0xbcc9[80]])}})[_0xbcc9[23]](function(){return _0x60c1x25[_0xbcc9[79]]()})[_0xbcc9[23]](function(_0x60c1x26){return _0x60c1x13[_0xbcc9[22]](200)[_0xbcc9[21]](_[_0xbcc9[32]](_0x60c1x25[_0xbcc9[78]],{Users:_0x60c1x26}))})[_0xbcc9[20]](function(_0x60c1x15){return handleError(_0x60c1x13,_0x60c1x15)})};exports[_0xbcc9[88]]= function(_0x60c1x12,_0x60c1x13,_0x60c1x14){var _0x60c1x25;return ChatRoom[_0xbcc9[37]](_0x60c1x12[_0xbcc9[50]][_0xbcc9[26]])[_0xbcc9[23]](function(_0x60c1x24){_0x60c1x25= _0x60c1x24;if(!_0x60c1x25){return _0x60c1x13[_0xbcc9[51]](404)}})[_0xbcc9[23]](function(){return ChatMessage[_0xbcc9[90]](_[_0xbcc9[32]](_0x60c1x12[_0xbcc9[47]],{type:_0x60c1x25[_0xbcc9[89]],ChatRoomId:_0x60c1x12[_0xbcc9[50]][_0xbcc9[26]],UserId:_0x60c1x12[_0xbcc9[38]][_0xbcc9[26]]}))})[_0xbcc9[23]](function(_0x60c1x28){return _0x60c1x13[_0xbcc9[22]](200)[_0xbcc9[21]](_0x60c1x28)})[_0xbcc9[20]](function(_0x60c1x15){return handleError(_0x60c1x13,_0x60c1x15)})};exports[_0xbcc9[91]]= function(_0x60c1x12,_0x60c1x13,_0x60c1x14){return ChatRoom[_0xbcc9[37]](_0x60c1x12[_0xbcc9[50]][_0xbcc9[26]],{include:[{model:ChatMessage,include:[{model:ChatVisitor,attributes:[_0xbcc9[26],_0xbcc9[28]]},{model:User,attributes:[_0xbcc9[26],_0xbcc9[28]]}]}]})[_0xbcc9[23]](function(_0x60c1x24){var _0x60c1x29=[];_0x60c1x24[_0xbcc9[96]][_0xbcc9[95]](function(_0x60c1x28){_0x60c1x29[_0xbcc9[58]]({name:_0x60c1x28[_0xbcc9[9]]?_0x60c1x28[_0xbcc9[9]][_0xbcc9[28]]:_0x60c1x28[_0xbcc9[16]][_0xbcc9[28]],text:_0x60c1x28[_0xbcc9[47]][_0xbcc9[93]](/(\r\n|\n|\r)/gm,_0xbcc9[92]),date:_0x60c1x28[_0xbcc9[94]]})});return _0x60c1x13[_0xbcc9[89]](_0xbcc9[97])[_0xbcc9[22]](200)[_0xbcc9[21]](csv(_0x60c1x29))})[_0xbcc9[20]](function(_0x60c1x15){return handleError(_0x60c1x13,_0x60c1x15)})};exports[_0xbcc9[98]]= function(_0x60c1x12,_0x60c1x13){return User[_0xbcc9[37]](_0x60c1x12[_0xbcc9[38]][_0xbcc9[26]])[_0xbcc9[23]](function(_0x60c1x19){return _0x60c1x19[_0xbcc9[74]]({where:{type:_0x60c1x12[_0xbcc9[50]][_0xbcc9[89]]},include:[{model:ChatVisitor,attributes:[_0xbcc9[26],_0xbcc9[28],_0xbcc9[29]]}]})})[_0xbcc9[23]](function(_0x60c1x1f){if(!_0x60c1x1f){return _0x60c1x13[_0xbcc9[51]](404)};return _0x60c1x13[_0xbcc9[21]](_0x60c1x1f)})[_0xbcc9[20]](function(_0x60c1x15){return handleError(_0x60c1x13,_0x60c1x15)})};exports[_0xbcc9[99]]= function(_0x60c1x12,_0x60c1x13){return User[_0xbcc9[37]](_0x60c1x12[_0xbcc9[38]][_0xbcc9[26]])[_0xbcc9[23]](function(_0x60c1x19){return _0x60c1x19[_0xbcc9[74]]({include:[{model:ChatVisitor,attributes:[_0xbcc9[26],_0xbcc9[28],_0xbcc9[29]]},{model:User,attributes:[_0xbcc9[26],_0xbcc9[27],_0xbcc9[28],_0xbcc9[29],_0xbcc9[30],_0xbcc9[31]]}]})})[_0xbcc9[23]](function(_0x60c1x1f){if(!_0x60c1x1f){return _0x60c1x13[_0xbcc9[51]](404)};return _0x60c1x13[_0xbcc9[21]](_0x60c1x1f)})[_0xbcc9[20]](function(_0x60c1x15){return handleError(_0x60c1x13,_0x60c1x15)})};exports[_0xbcc9[90]]= function(_0x60c1x12,_0x60c1x13){};exports[_0xbcc9[52]]= function(_0x60c1x12,_0x60c1x13){if(_0x60c1x12[_0xbcc9[47]][_0xbcc9[26]]){delete _0x60c1x12[_0xbcc9[47]][_0xbcc9[26]]};return ChatRoom[_0xbcc9[37]](_0x60c1x12[_0xbcc9[50]][_0xbcc9[26]])[_0xbcc9[23]](function(_0x60c1x24){if(!_0x60c1x24){return _0x60c1x13[_0xbcc9[51]](404)};return _0x60c1x24[_0xbcc9[52]](_0x60c1x12[_0xbcc9[47]])})[_0xbcc9[23]](function(_0x60c1x24){return _0x60c1x13[_0xbcc9[22]](200)[_0xbcc9[21]](_0x60c1x24)})[_0xbcc9[20]](function(_0x60c1x15){return handleError(_0x60c1x13,_0x60c1x15)})};exports[_0xbcc9[100]]= function(_0x60c1x12,_0x60c1x13){var _0x60c1x25;if(_0x60c1x12[_0xbcc9[47]][_0xbcc9[26]]){delete _0x60c1x12[_0xbcc9[47]][_0xbcc9[26]]};return ChatRoom[_0xbcc9[37]](_0x60c1x12[_0xbcc9[50]][_0xbcc9[26]])[_0xbcc9[23]](function(_0x60c1x24){if(!_0x60c1x24||  !_0x60c1x12[_0xbcc9[47]][_0xbcc9[80]]){return _0x60c1x13[_0xbcc9[51]](404)};return _0x60c1x24})[_0xbcc9[23]](function(_0x60c1x24){return _0x60c1x24[_0xbcc9[52]]({type:_0xbcc9[63],token:md5(JSON[_0xbcc9[85]](_0x60c1x12[_0xbcc9[47]][_0xbcc9[80]][_0xbcc9[84]]())).toString(_0xbcc9[83])})})[_0xbcc9[23]](function(_0x60c1x24){_0x60c1x25= _0x60c1x24;return _0x60c1x24[_0xbcc9[81]](_0x60c1x12[_0xbcc9[47]][_0xbcc9[80]][_0xbcc9[84]](),{individualHooks:true})})[_0xbcc9[23]](function(){return _0x60c1x25[_0xbcc9[79]]()})[_0xbcc9[23]](function(_0x60c1x26){_[_0xbcc9[32]](_0x60c1x25[_0xbcc9[78]],{Users:_0x60c1x26});return _0x60c1x13[_0xbcc9[22]](200)[_0xbcc9[21]](_0x60c1x25)})[_0xbcc9[20]](function(_0x60c1x15){return handleError(_0x60c1x13,_0x60c1x15)})};exports[_0xbcc9[101]]= function(_0x60c1x12,_0x60c1x13){return ChatRoom[_0xbcc9[37]](_0x60c1x12[_0xbcc9[50]][_0xbcc9[26]])[_0xbcc9[23]](function(_0x60c1x24){if(!_0x60c1x24){return _0x60c1x13[_0xbcc9[51]](404)};return _0x60c1x24[_0xbcc9[101]]()})[_0xbcc9[23]](function(){return _0x60c1x13[_0xbcc9[51]](204)})[_0xbcc9[20]](function(_0x60c1x15){return handleError(_0x60c1x13,_0x60c1x15)})};function handleError(_0x60c1x13,_0x60c1x15){logger[_0xbcc9[103]](_0x60c1x15[_0xbcc9[102]]);return _0x60c1x13[_0xbcc9[22]](500)[_0xbcc9[21]](_0x60c1x15)}