b351f7853a23567b8d02b3e0e70420745ec51d2b
[motion.git] / server / api / mail_room / mail_room.controller.js
1 var _0x1f05=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x75\x74\x69\x6C","\x68\x74\x6D\x6C\x2D\x74\x6F\x2D\x74\x65\x78\x74","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x6D\x6F\x6D\x65\x6E\x74","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x55\x73\x65\x72","\x43\x6F\x6E\x74\x61\x63\x74","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x53\x74\x61\x74\x75\x73","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x4D\x61\x69\x6C\x4D\x65\x73\x73\x61\x67\x65","\x4D\x61\x69\x6C\x41\x63\x63\x6F\x75\x6E\x74","\x4D\x61\x69\x6C\x41\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E","\x4D\x61\x69\x6C\x51\x75\x65\x75\x65","\x4D\x61\x69\x6C\x41\x74\x74\x61\x63\x68\x6D\x65\x6E\x74","\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","\x64\x65\x66\x61\x75\x6C\x74","\x73\x63\x6F\x70\x65","\x64\x65\x73\x63\x72\x69\x62\x65","\x69\x64","\x6D\x61\x70","\x67\x65\x74\x4D\x61\x69\x6C\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","\x72\x6F\x6C\x65","\x70\x65\x6E\x64\x69\x6E\x67","\x6C\x6F\x67","\x50\x45\x4E\x44\x49\x4E\x47","\x6D\x65\x72\x67\x65","\x63\x6F\x75\x6E\x74","\x61\x6C\x6C","\x6E\x65\x77","\x4E\x45\x57","\x6F\x70\x65\x6E","\x4F\x50\x45\x4E","\x63\x6C\x6F\x73\x65\x64","\x43\x4C\x4F\x53\x45\x44","\x69\x6E\x62\x6F\x78","\x65\x72\x72\x6F\x72","\x53\x45\x4C\x45\x43\x54\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x69\x64\x60\x2C\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x73\x75\x62\x6A\x65\x63\x74\x60\x2C\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x66\x72\x6F\x6D\x60\x2C\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x61\x63\x63\x6F\x75\x6E\x74\x60\x2C\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x73\x74\x61\x74\x75\x73\x60\x2C\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x6C\x61\x73\x74\x45\x76\x65\x6E\x74\x60\x2C\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x75\x70\x64\x61\x74\x65\x64\x41\x74\x60\x20\x46\x52\x4F\x4D\x20\x60\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x60\x20\x41\x53\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x20\x4C\x45\x46\x54\x20\x4F\x55\x54\x45\x52\x20\x4A\x4F\x49\x4E\x20\x28\x60\x75\x73\x65\x72\x5F\x68\x61\x73\x5F\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x60\x20\x41\x53\x20\x60\x55\x73\x65\x72\x73\x2E\x75\x73\x65\x72\x5F\x68\x61\x73\x5F\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x60\x20\x49\x4E\x4E\x45\x52\x20\x4A\x4F\x49\x4E\x20\x60\x75\x73\x65\x72\x73\x60\x20\x41\x53\x20\x60\x55\x73\x65\x72\x73\x60\x20\x4F\x4E\x20\x60\x55\x73\x65\x72\x73\x60\x2E\x60\x69\x64\x60\x20\x3D\x20\x60\x55\x73\x65\x72\x73\x2E\x75\x73\x65\x72\x5F\x68\x61\x73\x5F\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x60\x2E\x60\x55\x73\x65\x72\x49\x64\x60\x29\x20\x4F\x4E\x20\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x69\x64\x60\x20\x3D\x20\x60\x55\x73\x65\x72\x73\x2E\x75\x73\x65\x72\x5F\x68\x61\x73\x5F\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x60\x2E\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x49\x64\x60\x20\x57\x48\x45\x52\x45\x20\x28\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x64\x65\x6C\x65\x74\x65\x64\x41\x74\x60\x20\x49\x53\x20\x4E\x55\x4C\x4C\x20\x41\x4E\x44\x20\x28\x60\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x60\x2E\x60\x73\x74\x61\x74\x75\x73\x60\x20\x3D\x20\x3A\x73\x74\x61\x74\x75\x73\x20\x4F\x52\x20\x60\x55\x73\x65\x72\x73\x60\x2E\x60\x69\x64\x60\x20\x3D\x20\x3A\x69\x64\x29\x29","\x55\x4E\x4D\x41\x4E\x41\x47\x45\x44","\x53\x45\x4C\x45\x43\x54","\x51\x75\x65\x72\x79\x54\x79\x70\x65\x73","\x61\x67\x65\x6E\x74","\x53\x45\x4C\x45\x43\x54\x20\x60\x69\x64\x60\x2C\x20\x60\x73\x75\x62\x6A\x65\x63\x74\x60\x2C\x20\x60\x66\x72\x6F\x6D\x60\x2C\x20\x60\x61\x63\x63\x6F\x75\x6E\x74\x60\x2C\x20\x60\x73\x74\x61\x74\x75\x73\x60\x2C\x20\x60\x6C\x61\x73\x74\x45\x76\x65\x6E\x74\x60\x20\x2C\x60\x75\x70\x64\x61\x74\x65\x64\x41\x74\x60\x20\x46\x52\x4F\x4D\x20\x60\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x60\x20\x57\x48\x45\x52\x45\x20\x60\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x73\x60\x2E\x60\x64\x65\x6C\x65\x74\x65\x64\x41\x74\x60\x20\x49\x53\x20\x4E\x55\x4C\x4C","\x61\x67\x65\x6E\x74\x49\x6E\x64\x65\x78","\x70\x61\x72\x61\x6D\x73","\x66\x69\x6E\x64\x41\x6C\x6C","\x75\x70\x64\x61\x74\x65\x52\x6F\x6F\x6D\x53\x74\x61\x74\x75\x73","\x62\x6F\x64\x79","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x2C","\x73\x70\x6C\x69\x74","\x6E\x61\x6D\x65","\x66\x75\x6C\x6C\x6E\x61\x6D\x65","\x62\x75\x6C\x6B\x43\x72\x65\x61\x74\x65","\x75\x70\x64\x61\x74\x65","\x67\x65\x74\x52\x6F\x6F\x6D\x42\x79\x4D\x65\x73\x73\x61\x67\x65","\x65\x6D\x61\x69\x6C","\x67\x65\x74\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x73\x68\x6F\x77","\x73\x68\x6F\x77\x41\x67\x65\x6E\x74\x73","\x69\x6E\x74\x65\x72\x6E\x61\x6C","\x67\x65\x74\x55\x73\x65\x72\x73","\x63\x72\x65\x61\x74\x65","\x73\x65\x6E\x64\x4D\x65\x73\x73\x61\x67\x65","\x55\x73\x65\x72\x49\x64","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D\x49\x64","\x61\x74\x74\x61\x63\x68\x6D\x65\x6E\x74","\x4D\x61\x69\x6C\x41\x74\x74\x61\x63\x68\x6D\x65\x6E\x74\x73","\x6C\x65\x6E\x67\x74\x68","\x74\x65\x78\x74","\x68\x74\x6D\x6C","\x66\x72\x6F\x6D\x53\x74\x72\x69\x6E\x67","\x75\x70\x64\x61\x74\x65\x50\x61\x74\x63\x68","\x75\x70\x64\x61\x74\x65\x41\x67\x65\x6E\x74\x73","\x61\x67\x65\x6E\x74\x73","\x73\x65\x74\x55\x73\x65\x72\x73","\x64\x65\x73\x74\x72\x6F\x79","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79","\x69\x64\x73"];_0x1f05[0];var _=require(_0x1f05[1]);var util=require(_0x1f05[2]);var htmlToText=require(_0x1f05[3]);var Util=require(_0x1f05[4]);var moment=require(_0x1f05[5]);var sequelize=require(_0x1f05[7])[_0x1f05[6]];var User=require(_0x1f05[7])[_0x1f05[8]];var Agent=require(_0x1f05[7])[_0x1f05[8]];var Contact=require(_0x1f05[7])[_0x1f05[9]];var Status=require(_0x1f05[7])[_0x1f05[10]];var MailRoom=require(_0x1f05[7])[_0x1f05[11]];var MailMessage=require(_0x1f05[7])[_0x1f05[12]];var MailAccount=require(_0x1f05[7])[_0x1f05[13]];var MailApplication=require(_0x1f05[7])[_0x1f05[14]];var MailQueue=require(_0x1f05[7])[_0x1f05[15]];var MailAttachment=require(_0x1f05[7])[_0x1f05[16]];exports[_0x1f05[17]]= function(_0xc47dx11,_0xc47dx12,_0xc47dx13){return MailRoom[_0x1f05[26]](_0x1f05[25])[_0x1f05[24]](Util[_0x1f05[23]](_0xc47dx11[_0x1f05[22]]))[_0x1f05[21]](function(_0xc47dx15){return _0xc47dx12[_0x1f05[20]](200)[_0x1f05[19]](_0xc47dx15)})[_0x1f05[18]](function(_0xc47dx14){return handleError(_0xc47dx12,_0xc47dx14)})};exports[_0x1f05[27]]= function(_0xc47dx11,_0xc47dx12){return MailRoom[_0x1f05[27]]()[_0x1f05[21]](function(_0xc47dx16){return _0xc47dx12[_0x1f05[20]](200)[_0x1f05[19]](_0xc47dx16)})[_0x1f05[18]](function(_0xc47dx14){return handleError(_0xc47dx12,_0xc47dx14)})};function getMailQueues(_0xc47dx18){return function(){switch(_0xc47dx18[_0x1f05[33]]){case _0x1f05[32]:return User[_0x1f05[31]](_0xc47dx18[_0x1f05[28]],{attributes:[_0x1f05[28]]})[_0x1f05[21]](Util[_0x1f05[30]]({},{attributes:[_0x1f05[28]]}))[_0x1f05[21]](function(_0xc47dx19){return {include:{model:MailAccount,include:{model:MailApplication,include:{model:MailQueue,where:{id:_[_0x1f05[29]](_0xc47dx19,_0x1f05[28])}}}}}});default:return {}}}}exports[_0x1f05[34]]= function(_0xc47dx11,_0xc47dx12){return Promise[_0x1f05[39]]([])[_0x1f05[21]](getMailQueues(_0xc47dx11[_0x1f05[32]]))[_0x1f05[21]](function(_0xc47dx1b){return MailRoom[_0x1f05[38]](_[_0x1f05[37]](Util[_0x1f05[23]](_0xc47dx11[_0x1f05[22]],{status:_0x1f05[36]}),_0xc47dx1b))})[_0x1f05[21]](function(_0xc47dx1a){return _0xc47dx12[_0x1f05[20]](200)[_0x1f05[19]]({value:_0xc47dx1a})})[_0x1f05[18]](function(_0xc47dx14){console[_0x1f05[35]](_0xc47dx14);return handleError(_0xc47dx12,_0xc47dx14)})};exports[_0x1f05[40]]= function(_0xc47dx11,_0xc47dx12){return Promise[_0x1f05[39]]([])[_0x1f05[21]](getMailQueues(_0xc47dx11[_0x1f05[32]]))[_0x1f05[21]](function(_0xc47dx1b){return MailRoom[_0x1f05[38]](_[_0x1f05[37]](Util[_0x1f05[23]](_0xc47dx11[_0x1f05[22]],{status:_0x1f05[41]}),_0xc47dx1b))})[_0x1f05[21]](function(_0xc47dx1a){return _0xc47dx12[_0x1f05[20]](200)[_0x1f05[19]]({value:_0xc47dx1a})})[_0x1f05[18]](function(_0xc47dx14){console[_0x1f05[35]](_0xc47dx14);return handleError(_0xc47dx12,_0xc47dx14)})};exports[_0x1f05[42]]= function(_0xc47dx11,_0xc47dx12){return Promise[_0x1f05[39]]([])[_0x1f05[21]](getMailQueues(_0xc47dx11[_0x1f05[32]]))[_0x1f05[21]](function(_0xc47dx1b){return MailRoom[_0x1f05[38]](_[_0x1f05[37]](Util[_0x1f05[23]](_0xc47dx11[_0x1f05[22]],{status:_0x1f05[43]}),_0xc47dx1b))})[_0x1f05[21]](function(_0xc47dx1a){return _0xc47dx12[_0x1f05[20]](200)[_0x1f05[19]]({value:_0xc47dx1a})})[_0x1f05[18]](function(_0xc47dx14){console[_0x1f05[35]](_0xc47dx14);return handleError(_0xc47dx12,_0xc47dx14)})};exports[_0x1f05[44]]= function(_0xc47dx11,_0xc47dx12){return Promise[_0x1f05[39]]([])[_0x1f05[21]](getMailQueues(_0xc47dx11[_0x1f05[32]]))[_0x1f05[21]](function(_0xc47dx1b){return MailRoom[_0x1f05[38]](_[_0x1f05[37]](Util[_0x1f05[23]](_0xc47dx11[_0x1f05[22]],{status:_0x1f05[45]}),_0xc47dx1b))})[_0x1f05[21]](function(_0xc47dx1a){return _0xc47dx12[_0x1f05[20]](200)[_0x1f05[19]]({value:_0xc47dx1a})})[_0x1f05[18]](function(_0xc47dx14){console[_0x1f05[35]](_0xc47dx14);return handleError(_0xc47dx12,_0xc47dx14)})};exports[_0x1f05[46]]= function(_0xc47dx11,_0xc47dx12,_0xc47dx13){switch(_0xc47dx11[_0x1f05[32]][_0x1f05[33]]){case _0x1f05[52]:return sequelize[_0x1f05[22]](_0x1f05[48],{replacements:{status:_0x1f05[49],id:_0xc47dx11[_0x1f05[32]][_0x1f05[28]]},type:sequelize[_0x1f05[51]][_0x1f05[50]]})[_0x1f05[21]](function(_0xc47dx15){return _0xc47dx12[_0x1f05[20]](200)[_0x1f05[19]](_0xc47dx15)})[_0x1f05[18]](function(_0xc47dx14){console[_0x1f05[47]](_0xc47dx14);return handleError(_0xc47dx12,_0xc47dx14)});default:return sequelize[_0x1f05[22]](_0x1f05[53],{replacements:{status:_0x1f05[49],id:_0xc47dx11[_0x1f05[32]][_0x1f05[28]]},type:sequelize[_0x1f05[51]][_0x1f05[50]]})[_0x1f05[21]](function(_0xc47dx15){return _0xc47dx12[_0x1f05[20]](200)[_0x1f05[19]](_0xc47dx15)})[_0x1f05[18]](function(_0xc47dx14){return handleError(_0xc47dx12,_0xc47dx14)})}};exports[_0x1f05[54]]= function(_0xc47dx11,_0xc47dx12,_0xc47dx13){return MailRoom[_0x1f05[56]]({where:{UserId:_0xc47dx11[_0x1f05[55]][_0x1f05[28]]},include:[{all:true}]})[_0x1f05[21]](function(_0xc47dx1c){return _0xc47dx12[_0x1f05[20]](200)[_0x1f05[19]](_0xc47dx1c)})[_0x1f05[18]](function(_0xc47dx14){return handleError(_0xc47dx12,_0xc47dx14)})};exports[_0x1f05[57]]= function(_0xc47dx11,_0xc47dx12,_0xc47dx13){var _0xc47dx1d;var _0xc47dx1e=[];console[_0x1f05[35]](_0xc47dx11[_0x1f05[58]]);console[_0x1f05[35]](_0xc47dx11[_0x1f05[55]]);return MailRoom[_0x1f05[65]](_0xc47dx11[_0x1f05[58]],{where:{id:_0xc47dx11[_0x1f05[55]][_0x1f05[28]][_0x1f05[61]](_0x1f05[60])},individualHooks:true})[_0x1f05[21]](function(){return Status[_0x1f05[64]](_[_0x1f05[29]](_0xc47dx11[_0x1f05[55]][_0x1f05[28]][_0x1f05[61]](_0x1f05[60]),function(_0xc47dx1f){return {status:_0xc47dx11[_0x1f05[58]][_0x1f05[20]],data1:_0xc47dx11[_0x1f05[32]][_0x1f05[62]],data2:_0xc47dx11[_0x1f05[32]][_0x1f05[63]],MailRoomId:_0xc47dx1f,UserId:_0xc47dx11[_0x1f05[32]][_0x1f05[28]]}}))})[_0x1f05[21]](function(_0xc47dx1c){return _0xc47dx12[_0x1f05[59]](200)})[_0x1f05[18]](function(_0xc47dx14){return handleError(_0xc47dx12,_0xc47dx14)})};exports[_0x1f05[66]]= function(_0xc47dx11,_0xc47dx12,_0xc47dx13){return MailMessage[_0x1f05[31]](_0xc47dx11[_0x1f05[55]][_0x1f05[28]])[_0x1f05[21]](function(_0xc47dx21){return _0xc47dx21[_0x1f05[68]]({include:[{model:MailAccount},{model:MailMessage,include:[{model:MailAttachment},{model:User,attributes:[_0x1f05[28],_0x1f05[62],_0x1f05[63],_0x1f05[67]]}]},{model:User,attributes:[_0x1f05[28],_0x1f05[62],_0x1f05[63],_0x1f05[67]]}]})})[_0x1f05[21]](function(_0xc47dx20){return _0xc47dx12[_0x1f05[19]](_0xc47dx20)})[_0x1f05[18]](function(_0xc47dx14){return handleError(_0xc47dx12,_0xc47dx14)})};exports[_0x1f05[69]]= function(_0xc47dx11,_0xc47dx12,_0xc47dx13){return MailRoom[_0x1f05[26]](_0x1f05[25])[_0x1f05[31]](_0xc47dx11[_0x1f05[55]][_0x1f05[28]])[_0x1f05[21]](function(_0xc47dx20){if(!_0xc47dx20){return _0xc47dx12[_0x1f05[59]](404)};return _0xc47dx12[_0x1f05[19]](_0xc47dx20)})[_0x1f05[18]](function(_0xc47dx14){console[_0x1f05[47]](_0xc47dx14);return handleError(_0xc47dx12,_0xc47dx14)})};exports[_0x1f05[70]]= function(_0xc47dx11,_0xc47dx12,_0xc47dx13){return MailRoom[_0x1f05[31]](_0xc47dx11[_0x1f05[55]][_0x1f05[28]])[_0x1f05[21]](function(_0xc47dx20){if(!_0xc47dx20){return _0xc47dx12[_0x1f05[59]](404)};return _0xc47dx20[_0x1f05[72]]({attributes:[_0x1f05[28],_0x1f05[62],_0x1f05[63],_0x1f05[67],_0x1f05[33],_0x1f05[71]]})})[_0x1f05[21]](function(_0xc47dx22){return _0xc47dx12[_0x1f05[19]](_0xc47dx22)})[_0x1f05[18]](function(_0xc47dx14){return handleError(_0xc47dx12,_0xc47dx14)})};exports[_0x1f05[73]]= function(_0xc47dx11,_0xc47dx12,_0xc47dx13){return MailRoom[_0x1f05[73]](_0xc47dx11[_0x1f05[58]])[_0x1f05[21]](function(_0xc47dx20){return _0xc47dx12[_0x1f05[20]](201)[_0x1f05[19]](_0xc47dx20)})[_0x1f05[18]](function(_0xc47dx14){return handleError(_0xc47dx12,_0xc47dx14)})};exports[_0x1f05[74]]= function(_0xc47dx11,_0xc47dx12,_0xc47dx13){_0xc47dx11[_0x1f05[58]][_0x1f05[75]]= _0xc47dx11[_0x1f05[32]][_0x1f05[28]];_0xc47dx11[_0x1f05[58]][_0x1f05[76]]= _0xc47dx11[_0x1f05[55]][_0x1f05[28]];_0xc47dx11[_0x1f05[58]][_0x1f05[77]]= (_0xc47dx11[_0x1f05[58]][_0x1f05[78]]&& _0xc47dx11[_0x1f05[58]][_0x1f05[78]][_0x1f05[79]])?true:false;_0xc47dx11[_0x1f05[58]][_0x1f05[80]]= _0xc47dx11[_0x1f05[58]][_0x1f05[80]]|| htmlToText[_0x1f05[82]](_0xc47dx11[_0x1f05[58]][_0x1f05[81]],{wordwrap:false});return MailRoom[_0x1f05[31]](_0xc47dx11[_0x1f05[58]].MailRoomId)[_0x1f05[21]](function(_0xc47dx20){return _0xc47dx20[_0x1f05[65]]({status:_0x1f05[36]},{user:_0xc47dx11[_0x1f05[32]]})})[_0x1f05[21]](function(){return MailMessage[_0x1f05[73]](_0xc47dx11[_0x1f05[58]],{include:[{model:MailAttachment}],user:_0xc47dx11[_0x1f05[32]]})})[_0x1f05[21]](function(_0xc47dx21){return _0xc47dx12[_0x1f05[20]](201)[_0x1f05[19]](_0xc47dx21)})[_0x1f05[18]](function(_0xc47dx14){return handleError(_0xc47dx12,_0xc47dx14)})};exports[_0x1f05[65]]= function(_0xc47dx11,_0xc47dx12,_0xc47dx13){return MailRoom[_0x1f05[31]](_0xc47dx11[_0x1f05[55]][_0x1f05[28]])[_0x1f05[21]](function(_0xc47dx20){if(!_0xc47dx20){return _0xc47dx12[_0x1f05[59]](404)};return _0xc47dx20[_0x1f05[65]](_0xc47dx11[_0x1f05[58]])})[_0x1f05[21]](function(_0xc47dx20){return _0xc47dx12[_0x1f05[20]](200)[_0x1f05[19]](_0xc47dx20)})[_0x1f05[18]](function(_0xc47dx14){return handleError(_0xc47dx12,_0xc47dx14)})};exports[_0x1f05[83]]= function(_0xc47dx11,_0xc47dx12,_0xc47dx13){var _0xc47dx23={where:{id:_0xc47dx11[_0x1f05[55]][_0x1f05[28]][_0x1f05[61]](_0x1f05[60])},user:_0xc47dx11[_0x1f05[32]],individualHooks:true};return MailRoom[_0x1f05[65]](_0xc47dx11[_0x1f05[58]],_0xc47dx23)[_0x1f05[21]](function(_0xc47dx1c){if(!_0xc47dx1c){return _0xc47dx12[_0x1f05[59]](404)};return _0xc47dx1c})[_0x1f05[21]](function(_0xc47dx1c){return _0xc47dx12[_0x1f05[59]](200)})[_0x1f05[18]](function(_0xc47dx14){return handleError(_0xc47dx12,_0xc47dx14)})};exports[_0x1f05[84]]= function(_0xc47dx11,_0xc47dx12,_0xc47dx13){return MailRoom[_0x1f05[31]](_0xc47dx11[_0x1f05[55]][_0x1f05[28]])[_0x1f05[21]](function(_0xc47dx20){if(!_0xc47dx20){return _0xc47dx12[_0x1f05[59]](404)};return _0xc47dx20[_0x1f05[86]](_0xc47dx11[_0x1f05[58]][_0x1f05[85]],{individualHooks:true})})[_0x1f05[21]](function(){return _0xc47dx12[_0x1f05[59]](200)})[_0x1f05[18]](function(_0xc47dx14){return handleError(_0xc47dx12,_0xc47dx14)})};exports[_0x1f05[87]]= function(_0xc47dx11,_0xc47dx12,_0xc47dx13){return MailRoom[_0x1f05[31]](_0xc47dx11[_0x1f05[55]][_0x1f05[28]])[_0x1f05[21]](function(_0xc47dx20){if(!_0xc47dx20){return _0xc47dx12[_0x1f05[59]](404)};return _0xc47dx20[_0x1f05[87]]()})[_0x1f05[21]](function(){return _0xc47dx12[_0x1f05[59]](204)})[_0x1f05[18]](function(_0xc47dx14){return handleError(_0xc47dx12,_0xc47dx14)})};exports[_0x1f05[88]]= function(_0xc47dx11,_0xc47dx12){return MailRoom[_0x1f05[87]]({where:{id:_0xc47dx11[_0x1f05[22]][_0x1f05[89]]},individualHooks:true})[_0x1f05[21]](function(){return _0xc47dx12[_0x1f05[59]](200)})[_0x1f05[18]](function(_0xc47dx14){return handleError(_0xc47dx12,_0xc47dx14)})};function handleError(_0xc47dx12,_0xc47dx14){return _0xc47dx12[_0x1f05[20]](500)[_0x1f05[19]](_0xc47dx14)}