4715c196aa22701fd4373c1ce619b8a3992ff93c
[motion.git] / server / api / chat_message / chat_message.socket.js
1 var _0x4b19=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x43\x68\x61\x74\x4D\x65\x73\x73\x61\x67\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x55\x73\x65\x72","\x43\x68\x61\x74\x56\x69\x73\x69\x74\x6F\x72","\x43\x68\x61\x74\x52\x6F\x6F\x6D","\x2E\x2F\x63\x68\x61\x74\x5F\x6D\x65\x73\x73\x61\x67\x65\x2E\x65\x76\x65\x6E\x74\x73","\x73\x61\x76\x65","\x72\x65\x6D\x6F\x76\x65","\x72\x65\x67\x69\x73\x74\x65\x72","\x6C\x65\x6E\x67\x74\x68","\x63\x68\x61\x74\x5F\x6D\x65\x73\x73\x61\x67\x65\x3A","\x6F\x6E","\x64\x69\x73\x63\x6F\x6E\x6E\x65\x63\x74","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x55\x73\x65\x72\x73","\x55\x73\x65\x72\x49\x64","\x66\x69\x6E\x64","\x69\x64","\x6D\x61\x70","\x75\x73\x65\x72\x49\x64","\x74\x6F\x49\x6E\x74\x65\x67\x65\x72","\x69\x6E\x63\x6C\x75\x64\x65\x73","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x6D\x65\x72\x67\x65","\x65\x6D\x69\x74","\x69\x6E\x74\x65\x72\x6E\x61\x6C","\x65\x78\x74\x65\x72\x6E\x61\x6C","\x61\x64\x6D\x69\x6E","\x75\x73\x65\x72","\x72\x6F\x6C\x65","\x67\x72\x6F\x75\x70","\x43\x68\x61\x74\x20\x52\x6F\x6F\x6D\x20\x74\x79\x70\x65\x20\x6E\x6F\x74\x20\x72\x65\x63\x6F\x67\x6E\x69\x7A\x65\x64","\x74\x79\x70\x65","\x74\x68\x65\x6E","\x43\x68\x61\x74\x52\x6F\x6F\x6D\x49\x64","\x6E\x61\x6D\x65","\x66\x75\x6C\x6C\x6E\x61\x6D\x65","\x65\x6D\x61\x69\x6C","\x75\x73\x65\x72\x70\x69\x63","\x72\x65\x6D\x6F\x76\x65\x4C\x69\x73\x74\x65\x6E\x65\x72"];_0x4b19[0];const _=require(_0x4b19[1]);const ChatMessage=require(_0x4b19[3])[_0x4b19[2]];const User=require(_0x4b19[3])[_0x4b19[4]];const ChatVisitor=require(_0x4b19[3])[_0x4b19[5]];const ChatRoom=require(_0x4b19[3])[_0x4b19[6]];const ChatMessageEvents=require(_0x4b19[7]);var events=[_0x4b19[8],_0x4b19[9]];exports[_0x4b19[10]]= function(_0xfa4ex8){for(var _0xfa4ex9=0,_0xfa4exa=events[_0x4b19[11]];_0xfa4ex9< _0xfa4exa;_0xfa4ex9++){var _0xfa4exb=events[_0xfa4ex9];var _0xfa4exc=createListener(_0x4b19[12]+ _0xfa4exb,_0xfa4ex8);ChatMessageEvents[_0x4b19[13]](_0xfa4exb,_0xfa4exc);_0xfa4ex8[_0x4b19[13]](_0x4b19[14],removeListener(_0xfa4exb,_0xfa4exc))}};function createListener(_0xfa4exb,_0xfa4ex8){return function(_0xfa4exe){return ChatRoom[_0x4b19[19]]({where:{id:_0xfa4exe[_0x4b19[37]]},include:[{model:User,attributes:[_0x4b19[20],_0x4b19[38],_0x4b19[39],_0x4b19[40],_0x4b19[32],_0x4b19[28],_0x4b19[41]]},{model:ChatVisitor,attributes:[_0x4b19[20],_0x4b19[39],_0x4b19[40]]}]})[_0x4b19[36]](function(_0xfa4ex10){if(_0xfa4ex10){var _0xfa4ex11=_0xfa4ex10[_0x4b19[17]];var _0xfa4ex12=_0xfa4ex10[_0x4b19[5]];var _0xfa4ex13=_[_0x4b19[19]](_0xfa4ex11,{id:_0xfa4exe[_0x4b19[18]]});var _0xfa4ex14=_[_0x4b19[21]](_0xfa4ex11,_0x4b19[20]);switch(_0xfa4ex10[_0x4b19[35]]){case _0x4b19[28]:if(_[_0x4b19[24]](_0xfa4ex14,_[_0x4b19[23]](_0xfa4ex8[_0x4b19[22]]))&& (_0xfa4ex13|| _0xfa4ex12)){_0xfa4ex8[_0x4b19[27]](_0xfa4exb,_[_0x4b19[26]](_0xfa4exe[_0x4b19[25]],{User:_0xfa4ex13,ChatVisitor:_0xfa4ex13?null:_0xfa4ex12,userids:_0xfa4ex14}))};break;case _0x4b19[29]:;case _0x4b19[33]:if((_[_0x4b19[24]](_0xfa4ex14,_[_0x4b19[23]](_0xfa4ex8[_0x4b19[22]]))|| _[_0x4b19[24]]([_0x4b19[30],_0x4b19[31]],_0xfa4ex8[_0x4b19[32]]))&& (_0xfa4ex13|| _0xfa4ex12)){_0xfa4ex8[_0x4b19[27]](_0xfa4exb,_[_0x4b19[26]](_0xfa4exe[_0x4b19[25]],{User:_0xfa4ex13,ChatVisitor:_0xfa4ex13?null:_0xfa4ex12,userids:_0xfa4ex14}))};break;default:console[_0x4b19[15]](_0x4b19[34],_0xfa4ex10[_0x4b19[35]])}}})[_0x4b19[16]](function(_0xfa4exf){console[_0x4b19[15]](_0xfa4exf)})}}function removeListener(_0xfa4exb,_0xfa4exc){return function(){ChatMessageEvents[_0x4b19[42]](_0xfa4exb,_0xfa4exc)}}