Built motion from commit 3848e0076.|1.0.27
[motion.git] / server / config / openchannel / custom.js
index aa25b2d..9bf55d7 100644 (file)
@@ -1 +1 @@
-var _0x1dcf=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x62\x6C\x75\x65\x62\x69\x72\x64","\x2E\x2E\x2F\x75\x74\x69\x6C","\x6D\x6F\x6D\x65\x6E\x74","\x70\x61\x74\x68","\x75\x74\x69\x6C","\x66\x73","\x55\x73\x65\x72","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x52\x6F\x6F\x6D","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x4D\x65\x73\x73\x61\x67\x65","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x41\x63\x63\x6F\x75\x6E\x74","\x52\x65\x70\x6F\x72\x74\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C","\x41\x63\x74\x69\x6F\x6E","\x43\x6F\x6E\x74\x61\x63\x74","\x2E\x2E\x2F\x72\x6F\x75\x74\x69\x6E\x67\x2F\x73\x63\x68\x65\x64\x75\x6C\x65\x72","\x6F\x70\x65\x6E\x20\x63\x68\x61\x6E\x6E\x65\x6C\x20\x49\x6E\x69\x74\x69\x61\x6C\x69\x7A\x61\x74\x69\x6F\x6E\x2E\x2E\x2E","\x6C\x6F\x67","\x61\x63\x63\x6F\x75\x6E\x74","\x69\x6E\x69\x74","\x70\x72\x6F\x74\x6F\x74\x79\x70\x65","\x4F\x70\x65\x6E\x20\x63\x68\x61\x6E\x6E\x65\x6C\x20\x2D\x20\x41\x63\x63\x6F\x75\x6E\x74\x20","\x6E\x61\x6D\x65","\x20\x43\x52\x45\x41\x54\x45","\x69\x64","\x6F\x6E\x55\x70\x64\x61\x74\x65","\x61\x66\x74\x65\x72\x55\x70\x64\x61\x74\x65","\x61\x63\x63\x6F\x75\x6E\x74\x69\x64","\x6F\x6E\x52\x65\x70\x6F\x72\x74\x55\x70\x64\x61\x74\x65","\x6F\x6E\x52\x65\x6D\x6F\x76\x65","\x61\x66\x74\x65\x72\x44\x65\x73\x74\x72\x6F\x79","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x41\x63\x63\x6F\x75\x6E\x74\x49\x64","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x73\x74\x61\x74\x75\x73","\x52\x45\x43\x45\x49\x56\x45\x44","\x6F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C","\x25\x73\x2E\x25\x73","\x75\x6E\x69\x78","\x66\x6F\x72\x6D\x61\x74","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x52\x6F\x6F\x6D\x49\x64","\x66\x72\x6F\x6D","\x6F\x6E\x53\x65\x6E\x64","\x61\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65","\x73\x74\x61\x74\x65","\x63\x68\x61\x6E\x67\x65\x64","\x20\x55\x50\x44\x41\x54\x45","\x5B\x4F\x70\x65\x6E\x20\x63\x68\x61\x6E\x6E\x65\x6C\x20\x2D\x20\x41\x63\x63\x6F\x75\x6E\x74\x20","\x20\x44\x45\x53\x54\x52\x4F\x59","\x53\x45\x4E\x44\x49\x4E\x47","\x65\x72\x72","\x45\x72\x72\x6F\x72\x20\x75\x70\x64\x61\x74\x69\x6E\x67\x20\x65\x72\x72\x6F\x72\x20\x73\x74\x61\x74\x75\x73","\x63\x61\x74\x63\x68","\x46\x41\x49\x4C\x45\x44","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x75\x70\x64\x61\x74\x65\x41\x74\x74\x72\x69\x62\x75\x74\x65\x73","\x74\x68\x65\x6E","\x73\x74\x72\x69\x6E\x67\x69\x66\x79","\x75\x70\x64\x61\x74\x65","\x53\x45\x4E\x54","\x20\x4D\x65\x73\x73\x61\x67\x65\x20\x53\x45\x4E\x54\x2E\x2E\x2E","\x53\x45\x4E\x44\x49\x4E\x47\x20\x4D\x65\x73\x73\x61\x67\x65\x2E\x2E\x2E","\x72\x65\x70\x6C\x79\x4D\x65\x74\x68\x6F\x64","\x72\x65\x70\x6C\x79\x55\x72\x6C","\x74\x6F","\x62\x6F\x64\x79","\x55\x73\x65\x72\x49\x64","\x73\x65\x6E\x64\x52\x65\x71\x75\x65\x73\x74","\x45\x52\x52\x4F\x52","\x20\x41\x63\x63\x6F\x75\x6E\x74\x20\x48\x54\x54\x50\x20\x4D\x65\x74\x68\x6F\x64\x20\x6F\x72\x20\x55\x52\x4C\x20\x69\x73\x20\x6E\x6F\x74\x20\x63\x6F\x6E\x66\x69\x67\x75\x72\x65\x64\x2E\x20\x43\x6F\x6E\x74\x61\x63\x74\x20\x79\x6F\x75\x72\x20\x61\x64\x6D\x69\x6E\x69\x73\x74\x72\x61\x74\x6F\x72\x21\x21","\x61\x64\x64\x55\x73\x65\x72","\x66\x69\x6E\x64\x42\x79\x49\x64","\x50\x45\x4E\x44\x49\x4E\x47","\x6F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x4F\x75\x74","\x75\x73\x65\x72","\x73\x65\x74\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x52\x6F\x6F\x6D","\x61\x6C\x6C","\x43\x4C\x4F\x53\x45\x44","\x63\x72\x65\x61\x74\x65","\x63\x72\x65\x61\x74\x65\x64\x41\x74","\x44\x45\x53\x43","\x66\x69\x6E\x64\x41\x6C\x6C","\x72\x65\x71\x75\x65\x73\x74\x20\x66\x61\x69\x6C\x65\x64\x21","\x72\x65\x71\x75\x65\x73\x74\x20\x73\x75\x63\x63\x65\x73\x73\x65\x66\x75\x6C\x21","\x63\x6F\x6E\x6E\x65\x63\x74\x69\x64","\x61\x63\x63\x65\x70\x74\x4D\x65\x74\x68\x6F\x64","\x61\x63\x63\x65\x70\x74\x55\x72\x6C","\x6C\x65\x6E\x67\x74\x68","\x61\x63\x74\x69\x6F\x6E\x73","\x65\x6E\x61\x62\x6C\x65\x64","\x65\x78\x65\x63\x41\x63\x74\x69\x6F\x6E","\x66\x6F\x72\x45\x61\x63\x68","\x72\x65\x6A\x65\x63\x74\x65\x64\x41\x74","\x72\x65\x6A\x65\x63\x74\x4D\x65\x74\x68\x6F\x64","\x72\x65\x6A\x65\x63\x74\x55\x72\x6C","\x65\x78\x70\x6F\x72\x74\x73"];_0x1dcf[0];var _=require(_0x1dcf[1]);var Promise=require(_0x1dcf[2]);var Util=require(_0x1dcf[3]);var moment=require(_0x1dcf[4]);var path=require(_0x1dcf[5]);var util=require(_0x1dcf[6]);var fs=require(_0x1dcf[7]);var Agent=require(_0x1dcf[9])[_0x1dcf[8]];var OpenchannelRoom=require(_0x1dcf[9])[_0x1dcf[10]];var OpenchannelMessage=require(_0x1dcf[9])[_0x1dcf[11]];var OpenchannelAccount=require(_0x1dcf[9])[_0x1dcf[12]];var ReportOpenchannel=require(_0x1dcf[9])[_0x1dcf[13]];var Action=require(_0x1dcf[9])[_0x1dcf[14]];var path=require(_0x1dcf[5]);var fs=require(_0x1dcf[7]);var Contact=require(_0x1dcf[9])[_0x1dcf[15]];var Scheduler=require(_0x1dcf[16]);function Custom(){console[_0x1dcf[18]](_0x1dcf[17]);this[_0x1dcf[19]]= null}Custom[_0x1dcf[21]][_0x1dcf[20]]= function(_0xf31bx11){var _0xf31bx12=this;console[_0x1dcf[18]](_0x1dcf[22]+ _0xf31bx11[_0x1dcf[23]]+ _0x1dcf[24]);_0xf31bx12[_0x1dcf[19]]= _0xf31bx11;OpenchannelAccount[_0x1dcf[27]](function(_0xf31bx11){if(_0xf31bx12[_0x1dcf[19]]&& _0xf31bx11[_0x1dcf[25]]=== _0xf31bx12[_0x1dcf[19]][_0x1dcf[25]]){_0xf31bx12[_0x1dcf[26]](_0xf31bx11)}});ReportOpenchannel[_0x1dcf[27]](function(_0xf31bx11){if(_0xf31bx12[_0x1dcf[19]]&& _0xf31bx11[_0x1dcf[28]]== _0xf31bx12[_0x1dcf[19]][_0x1dcf[25]]){_0xf31bx12[_0x1dcf[29]](_0xf31bx11)}});OpenchannelAccount[_0x1dcf[31]](function(_0xf31bx11){if(_0xf31bx12[_0x1dcf[19]]&& _0xf31bx11[_0x1dcf[25]]=== _0xf31bx12[_0x1dcf[19]][_0x1dcf[25]]){_0xf31bx12[_0x1dcf[30]](_0xf31bx11)}});OpenchannelMessage[_0x1dcf[43]](function(_0xf31bx11,_0xf31bx13){if(_0xf31bx12[_0x1dcf[19]]&& _0xf31bx12[_0x1dcf[19]][_0x1dcf[25]]== _0xf31bx11[_0x1dcf[33]][_0x1dcf[32]]){if(_0xf31bx11[_0x1dcf[34]]=== _0x1dcf[35]){var _0xf31bx14= new Scheduler({channel:_0x1dcf[36],uniqueid:util[_0x1dcf[39]](_0x1dcf[37],moment()[_0x1dcf[38]](),_0xf31bx11.OpenchannelRoomId),messageid:_0xf31bx11[_0x1dcf[25]],roomid:_0xf31bx11[_0x1dcf[40]],accountid:_0xf31bx12[_0x1dcf[19]][_0x1dcf[25]],accountname:_0xf31bx12[_0x1dcf[19]][_0x1dcf[23]],from:_0xf31bx11[_0x1dcf[41]]});_0xf31bx14[_0x1dcf[20]]()};_0xf31bx12[_0x1dcf[42]](_0xf31bx11,_0xf31bx13)}})};Custom[_0x1dcf[21]][_0x1dcf[26]]= function(_0xf31bx11){if(!_0xf31bx11[_0x1dcf[45]](_0x1dcf[44])){console[_0x1dcf[18]](_0x1dcf[22]+ _0xf31bx11[_0x1dcf[23]]+ _0x1dcf[46]);this[_0x1dcf[19]]= null;this[_0x1dcf[19]]= _0xf31bx11}};Custom[_0x1dcf[21]][_0x1dcf[30]]= function(_0xf31bx11){console[_0x1dcf[18]](_0x1dcf[47]+ _0xf31bx11[_0x1dcf[23]]+ _0x1dcf[48]);this[_0x1dcf[19]]= null};Custom[_0x1dcf[21]][_0x1dcf[42]]= function(_0xf31bx15,_0xf31bx13){var _0xf31bx16=this[_0x1dcf[19]];var _0xf31bx17=_0xf31bx15;var _0xf31bx18;var _0xf31bx19;if(_0xf31bx17[_0x1dcf[34]]=== _0x1dcf[49]){return Promise[_0x1dcf[76]]([])[_0x1dcf[56]](getRoom(_0xf31bx17))[_0x1dcf[56]](function(_0xf31bx1e){_0xf31bx18= _0xf31bx1e;return _0xf31bx17[_0x1dcf[75]](_0xf31bx1e[_0x1dcf[25]])})[_0x1dcf[56]](function(){return _0xf31bx18[_0x1dcf[55]]({status:_0x1dcf[72],lastEvent:_0x1dcf[49],lastEventAt:moment()[_0x1dcf[39]](_0x1dcf[54]),openchannelOut:++_0xf31bx18[_0x1dcf[73]]},{individualHooks:true,user:_0xf31bx13[_0x1dcf[74]]})})[_0x1dcf[56]](function(_0xf31bx1c){return Agent[_0x1dcf[71]](_0xf31bx17.UserId)})[_0x1dcf[56]](function(_0xf31bx1d){_0xf31bx19= _0xf31bx1d;return _0xf31bx18[_0x1dcf[70]](_0xf31bx19)})[_0x1dcf[56]](function(){console[_0x1dcf[18]](_0x1dcf[61]);if(_0xf31bx16[_0x1dcf[62]]&& _0xf31bx16[_0x1dcf[63]]){var _0xf31bx1c={from:_0xf31bx17[_0x1dcf[41]],to:_0xf31bx17[_0x1dcf[64]],body:_0xf31bx17[_0x1dcf[65]],UserId:_0xf31bx17[_0x1dcf[66]],OpenchannelAccountId:_0xf31bx17[_0x1dcf[32]],OpenchannelRoomId:_0xf31bx17[_0x1dcf[40]]};return Util[_0x1dcf[67]](_0xf31bx1c,_0xf31bx16[_0x1dcf[62]],_0xf31bx16[_0x1dcf[63]])}else {throw {name:_0x1dcf[68],message:_0x1dcf[69]}}})[_0x1dcf[56]](function(_0xf31bx1b){console[_0x1dcf[18]](_0x1dcf[60]);return _0xf31bx17[_0x1dcf[58]]({status:_0x1dcf[59],res_data:JSON[_0x1dcf[57]](_0xf31bx1b)})})[_0x1dcf[56]](function(){return _0xf31bx18[_0x1dcf[55]]({lastEvent:_0x1dcf[59],lastEventAt:moment()[_0x1dcf[39]](_0x1dcf[54])})})[_0x1dcf[52]](function(_0xf31bx1a){console[_0x1dcf[18]](_0x1dcf[50],_0xf31bx1a);_0xf31bx17[_0x1dcf[58]]({status:_0x1dcf[53],res_data:JSON[_0x1dcf[57]](_0xf31bx1a)})[_0x1dcf[56]](function(){return _0xf31bx18[_0x1dcf[55]]({lastEvent:_0x1dcf[53],lastEventAt:moment()[_0x1dcf[39]](_0x1dcf[54])})})[_0x1dcf[52]](function(_0xf31bx1a){console[_0x1dcf[18]](_0x1dcf[51])})})}};function getRoom(_0xf31bx17){return function(){if(_0xf31bx17[_0x1dcf[40]]){return OpenchannelRoom[_0x1dcf[71]](_0xf31bx17.OpenchannelRoomId)}else {return OpenchannelRoom[_0x1dcf[81]]({limit:1,where:{contact:_0xf31bx17[_0x1dcf[64]],OpenchannelAccountId:_0xf31bx17[_0x1dcf[32]]},order:[[_0x1dcf[79],_0x1dcf[80]]]})[_0x1dcf[56]](function(_0xf31bx20){var _0xf31bx20=_0xf31bx20[0];if(!_0xf31bx20|| _0xf31bx20[_0x1dcf[34]]=== _0x1dcf[77]){var _0xf31bx21=_0xf31bx20?_0xf31bx20[_0x1dcf[25]]:null;return OpenchannelRoom[_0x1dcf[78]]({contact:_0xf31bx17[_0x1dcf[64]],OpenchannelAccountId:_0xf31bx17[_0x1dcf[32]],status:_0x1dcf[72],ParentId:_0xf31bx21})};return _0xf31bx20})}}}function execRequest(_0xf31bx11,_0xf31bx23,_0xf31bx24){Util[_0x1dcf[67]](_0xf31bx11,_0xf31bx23,_0xf31bx24)[_0x1dcf[56]](function(_0xf31bx25){console[_0x1dcf[18]](_0x1dcf[83])})[_0x1dcf[52]](function(_0xf31bx1a){console[_0x1dcf[18]](_0x1dcf[82])})}Custom[_0x1dcf[21]][_0x1dcf[29]]= function(_0xf31bx11){var _0xf31bx26=this[_0x1dcf[19]];if(_0xf31bx11[_0x1dcf[45]](_0x1dcf[84])){if(_0xf31bx26[_0x1dcf[85]]&& _0xf31bx26[_0x1dcf[86]]){execRequest(_0xf31bx11[_0x1dcf[33]],_0xf31bx26[_0x1dcf[85]],_0xf31bx26[_0x1dcf[86]])};if(_0xf31bx26[_0x1dcf[88]][_0x1dcf[87]]){_[_0x1dcf[91]](_0xf31bx26[_0x1dcf[88]],function(_0xf31bx27){if(_0xf31bx27[_0x1dcf[89]]){Util[_0x1dcf[90]](_0xf31bx27,_0xf31bx11)}})}};if(_0xf31bx11[_0x1dcf[45]](_0x1dcf[92])){if(_0xf31bx26[_0x1dcf[93]]&& _0xf31bx26[_0x1dcf[94]]){execRequest(_0xf31bx11[_0x1dcf[33]],_0xf31bx26[_0x1dcf[93]],_0xf31bx26[_0x1dcf[94]])}}};module[_0x1dcf[95]]= Custom
\ No newline at end of file
+var _0xe0ef=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x62\x6C\x75\x65\x62\x69\x72\x64","\x2E\x2E\x2F\x75\x74\x69\x6C","\x6D\x6F\x6D\x65\x6E\x74","\x70\x61\x74\x68","\x75\x74\x69\x6C","\x66\x73","\x55\x73\x65\x72","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x52\x6F\x6F\x6D","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x4D\x65\x73\x73\x61\x67\x65","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x41\x63\x63\x6F\x75\x6E\x74","\x52\x65\x70\x6F\x72\x74\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C","\x53\x6D\x73\x4D\x65\x73\x73\x61\x67\x65","\x4D\x61\x69\x6C\x4D\x65\x73\x73\x61\x67\x65","\x52\x65\x70\x6F\x72\x74\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x53\x65\x73\x73\x69\x6F\x6E","\x41\x63\x74\x69\x6F\x6E","\x63\x68\x69\x6C\x64\x5F\x70\x72\x6F\x63\x65\x73\x73","\x2E\x2E\x2F\x65\x6E\x76\x69\x72\x6F\x6E\x6D\x65\x6E\x74","\x43\x6F\x6E\x74\x61\x63\x74","\x6F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C","\x2E\x2E\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x20\x61\x63\x63\x6F\x75\x6E\x74\x20\x49\x6E\x69\x74\x69\x61\x6C\x69\x7A\x61\x74\x69\x6F\x6E\x2E\x2E\x2E","\x69\x6E\x66\x6F","\x61\x63\x63\x6F\x75\x6E\x74","\x61\x6D\x69","\x65\x78\x69\x74","\x70\x69\x64","\x72\x65\x6D\x6F\x76\x65","\x6C\x65\x6E\x67\x74\x68","\x75\x70\x64\x61\x74\x65","\x74\x68\x65\x6E","\x72\x6F\x6F\x6D\x69\x64","\x66\x69\x6E\x64\x42\x79\x49\x64","\x6F\x6E","\x6D\x65\x73\x73\x61\x67\x65","\x6D\x73\x67","\x63\x72\x65\x61\x74\x65","\x63\x72\x65\x61\x74\x65\x4D\x61\x69\x6C","\x63\x72\x65\x61\x74\x65\x53\x6D\x73","\x74\x79\x70\x65","\x73\x65\x6E\x64","\x63\x72\x65\x61\x74\x65\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x51\x75\x65\x75\x65\x53\x65\x73\x73\x69\x6F\x6E","\x72\x6F\x6F\x74","\x2F\x73\x65\x72\x76\x65\x72\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x66\x6F\x72\x6B\x65\x64\x5F\x72\x6F\x75\x74\x69\x6E\x67\x2F\x6F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x2F\x69\x6E\x64\x65\x78\x2E\x6A\x73","\x6A\x6F\x69\x6E","\x66\x6F\x72\x6B","\x73\x74\x61\x72\x74","\x25\x73\x2E\x25\x73","\x75\x6E\x69\x78","\x66\x6F\x72\x6D\x61\x74","\x73\x75\x62\x6A\x65\x63\x74","\x69\x64","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x52\x6F\x6F\x6D\x49\x64","\x6E\x61\x6D\x65","\x61\x64\x64\x72\x65\x73\x73","\x66\x72\x6F\x6D","\x70\x75\x73\x68","\x69\x6E\x69\x74","\x70\x72\x6F\x74\x6F\x74\x79\x70\x65","\x4F\x70\x65\x6E\x20\x63\x68\x61\x6E\x6E\x65\x6C\x20\x2D\x20\x41\x63\x63\x6F\x75\x6E\x74\x20","\x20\x43\x52\x45\x41\x54\x45","\x64\x65\x62\x75\x67","\x6F\x6E\x55\x70\x64\x61\x74\x65","\x61\x66\x74\x65\x72\x55\x70\x64\x61\x74\x65","\x61\x63\x63\x6F\x75\x6E\x74\x69\x64","\x67\x65\x74","\x63\x6F\x6E\x6E\x65\x63\x74\x69\x64","\x63\x68\x61\x6E\x67\x65\x64","\x73\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x61\x63\x63\x65\x70\x74","\x77\x65\x62\x68\x6F\x6F\x6B","\x66\x69\x6E\x61\x6C\x6C\x79","\x6D\x65\x73\x73\x61\x67\x65\x69\x64","\x66\x69\x6E\x64","\x73\x74\x6F\x70","\x6D\x65\x6D\x62\x65\x72\x6E\x61\x6D\x65","\x70\x72\x6F\x63\x65\x73\x73","\x6D\x65\x6D\x62\x65\x72\x69\x64","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x75\x6E\x69\x71\x75\x65\x69\x64","\x72\x65\x6A\x65\x63\x74\x65\x64\x41\x74","\x72\x65\x6A\x65\x63\x74","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x41\x63\x63\x6F\x75\x6E\x74\x49\x64","\x73\x74\x61\x74\x75\x73","\x43\x4C\x4F\x53\x45\x44","\x63\x6C\x6F\x73\x65","\x6F\x6E\x52\x65\x6D\x6F\x76\x65","\x61\x66\x74\x65\x72\x44\x65\x73\x74\x72\x6F\x79","\x52\x45\x43\x45\x49\x56\x45\x44","\x6F\x6E\x53\x65\x6E\x64","\x61\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65","\x73\x74\x61\x74\x65","\x20\x55\x50\x44\x41\x54\x45","\x5B\x4F\x70\x65\x6E\x20\x63\x68\x61\x6E\x6E\x65\x6C\x20\x2D\x20\x41\x63\x63\x6F\x75\x6E\x74\x20","\x20\x44\x45\x53\x54\x52\x4F\x59","\x53\x45\x4E\x44\x49\x4E\x47","\x45\x72\x72\x6F\x72\x20\x73\x65\x6E\x64\x69\x6E\x67\x20\x6D\x65\x73\x73\x61\x67\x65","\x45\x72\x72\x6F\x72\x20\x75\x70\x64\x61\x74\x69\x6E\x67\x20\x65\x72\x72\x6F\x72\x20\x73\x74\x61\x74\x75\x73","\x46\x41\x49\x4C\x45\x44","\x75\x70\x64\x61\x74\x65\x41\x74\x74\x72\x69\x62\x75\x74\x65\x73","\x73\x74\x72\x69\x6E\x67\x69\x66\x79","\x53\x45\x4E\x54","\x20\x4D\x65\x73\x73\x61\x67\x65\x20\x53\x45\x4E\x54\x2E\x2E\x2E","\x53\x45\x4E\x44\x49\x4E\x47\x20\x4D\x65\x73\x73\x61\x67\x65\x2E\x2E\x2E","\x72\x65\x70\x6C\x79\x4D\x65\x74\x68\x6F\x64","\x72\x65\x70\x6C\x79\x55\x72\x6C","\x74\x6F","\x62\x6F\x64\x79","\x55\x73\x65\x72\x49\x64","\x73\x65\x6E\x64\x52\x65\x71\x75\x65\x73\x74","\x45\x52\x52\x4F\x52","\x20\x41\x63\x63\x6F\x75\x6E\x74\x20\x48\x54\x54\x50\x20\x4D\x65\x74\x68\x6F\x64\x20\x6F\x72\x20\x55\x52\x4C\x20\x69\x73\x20\x6E\x6F\x74\x20\x63\x6F\x6E\x66\x69\x67\x75\x72\x65\x64\x2E\x20\x43\x6F\x6E\x74\x61\x63\x74\x20\x79\x6F\x75\x72\x20\x61\x64\x6D\x69\x6E\x69\x73\x74\x72\x61\x74\x6F\x72\x21\x21","\x61\x64\x64\x55\x73\x65\x72","\x50\x45\x4E\x44\x49\x4E\x47","\x6F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x4F\x75\x74","\x75\x73\x65\x72","\x73\x65\x74\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x52\x6F\x6F\x6D","\x61\x6C\x6C","\x63\x72\x65\x61\x74\x65\x64\x41\x74","\x44\x45\x53\x43","\x66\x69\x6E\x64\x41\x6C\x6C","\x72\x65\x71\x75\x65\x73\x74\x20\x66\x61\x69\x6C\x65\x64\x21","\x72\x65\x71\x75\x65\x73\x74\x20\x73\x75\x63\x63\x65\x73\x73\x65\x66\x75\x6C\x21","\x61\x63\x63\x65\x70\x74\x4D\x65\x74\x68\x6F\x64","\x61\x63\x63\x65\x70\x74\x55\x72\x6C","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x20\x61\x63\x63\x6F\x75\x6E\x74\x20\x3C","\x3E\x20\x65\x78\x65\x63\x75\x74\x69\x6E\x67\x20\x61\x63\x63\x65\x70\x74\x20\x77\x65\x62\x68\x6F\x6F\x6B","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x61\x63\x74\x69\x6F\x6E\x73","\x65\x6E\x61\x62\x6C\x65\x64","\x65\x78\x65\x63\x41\x63\x74\x69\x6F\x6E","\x66\x6F\x72\x45\x61\x63\x68","\x72\x65\x6A\x65\x63\x74\x4D\x65\x74\x68\x6F\x64","\x72\x65\x6A\x65\x63\x74\x55\x72\x6C","\x3E\x20\x65\x78\x65\x63\x75\x74\x69\x6E\x67\x20\x72\x65\x6A\x65\x63\x74\x20\x77\x65\x62\x68\x6F\x6F\x6B","\x63\x6C\x6F\x73\x65\x4D\x65\x74\x68\x6F\x64","\x63\x6C\x6F\x73\x65\x55\x72\x6C","\x3E\x20\x65\x78\x65\x63\x75\x74\x69\x6E\x67\x20\x63\x6C\x6F\x73\x65\x20\x77\x65\x62\x68\x6F\x6F\x6B","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x20\x57\x65\x62\x68\x6F\x6F\x6B\x20\x6E\x6F\x74\x20\x72\x65\x63\x6F\x67\x6E\x69\x7A\x65\x64","\x65\x78\x70\x6F\x72\x74\x73"];_0xe0ef[0];var _=require(_0xe0ef[1]);var Promise=require(_0xe0ef[2]);var Util=require(_0xe0ef[3]);var moment=require(_0xe0ef[4]);var path=require(_0xe0ef[5]);var util=require(_0xe0ef[6]);var fs=require(_0xe0ef[7]);var Agent=require(_0xe0ef[9])[_0xe0ef[8]];var OpenchannelRoom=require(_0xe0ef[9])[_0xe0ef[10]];var OpenchannelMessage=require(_0xe0ef[9])[_0xe0ef[11]];var OpenchannelAccount=require(_0xe0ef[9])[_0xe0ef[12]];var ReportOpenchannel=require(_0xe0ef[9])[_0xe0ef[13]];var SmsMessage=require(_0xe0ef[9])[_0xe0ef[14]];var MailMessage=require(_0xe0ef[9])[_0xe0ef[15]];var Session=require(_0xe0ef[9])[_0xe0ef[16]];var Action=require(_0xe0ef[9])[_0xe0ef[17]];var path=require(_0xe0ef[5]);var fs=require(_0xe0ef[7]);var cp=require(_0xe0ef[18]);var config=require(_0xe0ef[19]);var Contact=require(_0xe0ef[9])[_0xe0ef[20]];var logger=require(_0xe0ef[22])(_0xe0ef[21]);var processes=[];function Custom(_0x4278x17){logger[_0xe0ef[24]](_0xe0ef[23]);this[_0xe0ef[25]]= null;this[_0xe0ef[26]]= _0x4278x17}function createAndStartRouting(_0x4278x19,_0x4278x1a,_0x4278x17){var _0x4278x1b=cp[_0xe0ef[47]](path[_0xe0ef[46]](config[_0xe0ef[44]],_0xe0ef[45]))[_0xe0ef[35]](_0xe0ef[36],function(_0x4278x1e){switch(_0x4278x1e[_0xe0ef[41]]){case _0xe0ef[39]:return MailMessage[_0xe0ef[38]](_0x4278x1e[_0xe0ef[37]]);case _0xe0ef[40]:return SmsMessage[_0xe0ef[38]](_0x4278x1e[_0xe0ef[37]]);case _0xe0ef[43]:_0x4278x17[_0xe0ef[42]]({message:_0x4278x1e[_0xe0ef[41]],doc:_0x4278x1e[_0xe0ef[37]]});break;default:}})[_0xe0ef[35]](_0xe0ef[27],function(){var _0x4278x1c=_[_0xe0ef[29]](processes,{pid:this[_0xe0ef[28]]});if(_0x4278x1c&& _0x4278x1c[_0xe0ef[30]]){return OpenchannelRoom[_0xe0ef[34]](_0x4278x1c[0][_0xe0ef[33]])[_0xe0ef[32]](function(_0x4278x1d){if(_0x4278x1d){return _0x4278x1d[_0xe0ef[31]]({waiting:false})}})}});_0x4278x1b[_0xe0ef[42]]({type:_0xe0ef[48],param1:{channel:_0xe0ef[21],uniqueid:util[_0xe0ef[51]](_0xe0ef[49],moment()[_0xe0ef[50]](),_0x4278x19.OpenchannelRoomId),subject:_0x4278x19[_0xe0ef[52]],messageid:_0x4278x19[_0xe0ef[53]],roomid:_0x4278x19[_0xe0ef[54]],accountid:_0x4278x1a[_0xe0ef[53]],accountname:_0x4278x1a[_0xe0ef[55]],accountaddress:_0x4278x1a[_0xe0ef[56]],from:_0x4278x19[_0xe0ef[57]]},param2:_0x4278x19});processes[_0xe0ef[58]]({id:_0x4278x19[_0xe0ef[53]],channel:_0xe0ef[21],process:_0x4278x1b,roomid:_0x4278x19[_0xe0ef[54]],pid:_0x4278x1b[_0xe0ef[28]]})}Custom[_0xe0ef[60]][_0xe0ef[59]]= function(_0x4278x1f,_0x4278x20){var _0x4278x21=this;_0x4278x20&& logger[_0xe0ef[63]](_0xe0ef[61]+ _0x4278x1f[_0xe0ef[55]]+ _0xe0ef[62]);_0x4278x21[_0xe0ef[25]]= _0x4278x1f;OpenchannelAccount[_0xe0ef[65]](function(_0x4278x1f){if(_0x4278x21[_0xe0ef[25]]&& _0x4278x1f[_0xe0ef[53]]=== _0x4278x21[_0xe0ef[25]][_0xe0ef[53]]){_0x4278x21[_0xe0ef[64]](_0x4278x1f)}});ReportOpenchannel[_0xe0ef[65]](function(_0x4278x1f){if(_0x4278x21[_0xe0ef[25]]&& _0x4278x1f[_0xe0ef[66]]== _0x4278x21[_0xe0ef[25]][_0xe0ef[53]]){var _0x4278x22=_0x4278x1f[_0xe0ef[67]]({plain:true});if(_0x4278x1f[_0xe0ef[69]](_0xe0ef[68])){return Session[_0xe0ef[31]]({memberid:_0x4278x22[_0xe0ef[81]],membername:_0x4278x22[_0xe0ef[79]],leaveAt:moment()[_0xe0ef[51]](_0xe0ef[82])},{where:{uniqueid:_0x4278x22[_0xe0ef[83]],leaveAt:null},individualHooks:true})[_0xe0ef[32]](function(){var _0x4278x24=_[_0xe0ef[77]](processes,{id:_0x4278x22[_0xe0ef[76]]});if(_0x4278x24){_0x4278x24[_0xe0ef[80]][_0xe0ef[42]]({type:_0xe0ef[78],membername:_0x4278x22[_0xe0ef[79]]})}})[_0xe0ef[75]](function(){_0x4278x21[_0xe0ef[74]](_0x4278x1f,_0xe0ef[73])})[_0xe0ef[72]](function(_0x4278x23){logger[_0xe0ef[71]](_0x4278x23[_0xe0ef[70]])})}else {if(_0x4278x1f[_0xe0ef[69]](_0xe0ef[84])){var _0x4278x24=_[_0xe0ef[77]](processes,{id:_0x4278x22[_0xe0ef[76]]});if(_0x4278x24){_0x4278x24[_0xe0ef[80]][_0xe0ef[42]]({type:_0xe0ef[85],id:_0x4278x22[_0xe0ef[81]],membername:_0x4278x22[_0xe0ef[79]]})};_0x4278x21[_0xe0ef[74]](_0x4278x1f,_0xe0ef[85])}}}});OpenchannelRoom[_0xe0ef[65]](function(_0x4278x1f){if(_0x4278x21[_0xe0ef[25]]&& _0x4278x1f[_0xe0ef[86]]== _0x4278x21[_0xe0ef[25]][_0xe0ef[53]]){if(_0x4278x1f[_0xe0ef[69]](_0xe0ef[87])&& _0x4278x1f[_0xe0ef[87]]=== _0xe0ef[88]){_0x4278x21[_0xe0ef[74]](_0x4278x1f,_0xe0ef[89])}}});OpenchannelAccount[_0xe0ef[91]](function(_0x4278x1f){if(_0x4278x21[_0xe0ef[25]]&& _0x4278x1f[_0xe0ef[53]]=== _0x4278x21[_0xe0ef[25]][_0xe0ef[53]]){_0x4278x21[_0xe0ef[90]](_0x4278x1f)}});OpenchannelMessage[_0xe0ef[94]](function(_0x4278x1f,_0x4278x25){if(_0x4278x21[_0xe0ef[25]]&& _0x4278x21[_0xe0ef[25]][_0xe0ef[53]]== _0x4278x1f[_0xe0ef[86]]){if(_0x4278x1f[_0xe0ef[87]]=== _0xe0ef[92]){createAndStartRouting(_0x4278x1f[_0xe0ef[67]]({plain:true}),_0x4278x21[_0xe0ef[25]],_0x4278x21[_0xe0ef[26]])}else {_0x4278x21[_0xe0ef[93]](_0x4278x1f,_0x4278x25)}}})};Custom[_0xe0ef[60]][_0xe0ef[64]]= function(_0x4278x1f){if(!_0x4278x1f[_0xe0ef[69]](_0xe0ef[95])){logger[_0xe0ef[63]](_0xe0ef[61]+ _0x4278x1f[_0xe0ef[55]]+ _0xe0ef[96]);this[_0xe0ef[25]]= null;this[_0xe0ef[25]]= _0x4278x1f}};Custom[_0xe0ef[60]][_0xe0ef[90]]= function(_0x4278x1f){logger[_0xe0ef[63]](_0xe0ef[97]+ _0x4278x1f[_0xe0ef[55]]+ _0xe0ef[98]);this[_0xe0ef[25]]= null};Custom[_0xe0ef[60]][_0xe0ef[93]]= function(_0x4278x26,_0x4278x25){var _0x4278x27=this[_0xe0ef[25]];var _0x4278x28=_0x4278x26;var _0x4278x29;var _0x4278x2a;if(_0x4278x28[_0xe0ef[87]]=== _0xe0ef[99]){return Promise[_0xe0ef[121]]([])[_0xe0ef[32]](getRoom(_0x4278x28))[_0xe0ef[32]](function(_0x4278x2d){_0x4278x29= _0x4278x2d;return _0x4278x28[_0xe0ef[120]](_0x4278x2d[_0xe0ef[53]])})[_0xe0ef[32]](function(){return _0x4278x29[_0xe0ef[103]]({status:_0xe0ef[117],lastEvent:_0xe0ef[99],lastEventAt:moment()[_0xe0ef[51]](_0xe0ef[82]),openchannelOut:++_0x4278x29[_0xe0ef[118]]},{individualHooks:true,user:_0x4278x25[_0xe0ef[119]]})})[_0xe0ef[32]](function(_0x4278x19){return Agent[_0xe0ef[34]](_0x4278x28.UserId)})[_0xe0ef[32]](function(_0x4278x2c){_0x4278x2a= _0x4278x2c;return _0x4278x29[_0xe0ef[116]](_0x4278x2a)})[_0xe0ef[32]](function(){logger[_0xe0ef[24]](_0xe0ef[107]);if(_0x4278x27[_0xe0ef[108]]&& _0x4278x27[_0xe0ef[109]]){var _0x4278x19={from:_0x4278x28[_0xe0ef[57]],to:_0x4278x28[_0xe0ef[110]],body:_0x4278x28[_0xe0ef[111]],UserId:_0x4278x28[_0xe0ef[112]],OpenchannelAccountId:_0x4278x28[_0xe0ef[86]],OpenchannelRoomId:_0x4278x28[_0xe0ef[54]]};return Util[_0xe0ef[113]](_0x4278x19,_0x4278x27[_0xe0ef[108]],_0x4278x27[_0xe0ef[109]])}else {throw {name:_0xe0ef[114],message:_0xe0ef[115]}}})[_0xe0ef[32]](function(_0x4278x2b){logger[_0xe0ef[24]](_0xe0ef[106]);return _0x4278x28[_0xe0ef[31]]({status:_0xe0ef[105],res_data:JSON[_0xe0ef[104]](_0x4278x2b)})})[_0xe0ef[32]](function(){return _0x4278x29[_0xe0ef[103]]({lastEvent:_0xe0ef[105],lastEventAt:moment()[_0xe0ef[51]](_0xe0ef[82])})})[_0xe0ef[72]](function(_0x4278x23){logger[_0xe0ef[71]](_0xe0ef[100],_0x4278x23[_0xe0ef[70]]);_0x4278x28[_0xe0ef[31]]({status:_0xe0ef[102],res_data:JSON[_0xe0ef[104]](_0x4278x23)})[_0xe0ef[32]](function(){return _0x4278x29[_0xe0ef[103]]({lastEvent:_0xe0ef[102],lastEventAt:moment()[_0xe0ef[51]](_0xe0ef[82])})})[_0xe0ef[72]](function(_0x4278x23){logger[_0xe0ef[71]](_0xe0ef[101])})})}};function getRoom(_0x4278x28){return function(){if(_0x4278x28[_0xe0ef[54]]){return OpenchannelRoom[_0xe0ef[34]](_0x4278x28.OpenchannelRoomId)}else {return OpenchannelRoom[_0xe0ef[124]]({limit:1,where:{contact:_0x4278x28[_0xe0ef[110]],OpenchannelAccountId:_0x4278x28[_0xe0ef[86]]},order:[[_0xe0ef[122],_0xe0ef[123]]]})[_0xe0ef[32]](function(_0x4278x2f){var _0x4278x1d=_0x4278x2f[0];if(!_0x4278x1d|| _0x4278x1d[_0xe0ef[87]]=== _0xe0ef[88]){var _0x4278x30=_0x4278x1d?_0x4278x1d[_0xe0ef[53]]:null;return OpenchannelRoom[_0xe0ef[38]]({contact:_0x4278x28[_0xe0ef[110]],OpenchannelAccountId:_0x4278x28[_0xe0ef[86]],status:_0xe0ef[117],ParentId:_0x4278x30})};return _0x4278x1d})}}}function execRequest(_0x4278x1f,_0x4278x32,_0x4278x33){Util[_0xe0ef[113]](_0x4278x1f,_0x4278x32,_0x4278x33)[_0xe0ef[32]](function(_0x4278x34){logger[_0xe0ef[63]](_0xe0ef[126])})[_0xe0ef[72]](function(_0x4278x23){logger[_0xe0ef[63]](_0xe0ef[125])})}Custom[_0xe0ef[60]][_0xe0ef[74]]= function(_0x4278x1f,_0x4278x35){var _0x4278x27=this[_0xe0ef[25]];switch(_0x4278x35){case _0xe0ef[73]:if(_0x4278x27[_0xe0ef[127]]&& _0x4278x27[_0xe0ef[128]]){logger[_0xe0ef[63]](_0xe0ef[129]+ _0x4278x27[_0xe0ef[55]]+ _0xe0ef[130]);execRequest(_0x4278x1f[_0xe0ef[131]],_0x4278x27[_0xe0ef[127]],_0x4278x27[_0xe0ef[128]])};if(_0x4278x27[_0xe0ef[132]][_0xe0ef[30]]){_[_0xe0ef[135]](_0x4278x27[_0xe0ef[132]],function(_0x4278x36){if(_0x4278x36[_0xe0ef[133]]){Util[_0xe0ef[134]](_0x4278x36,_0x4278x1f)}})};break;case _0xe0ef[85]:if(_0x4278x27[_0xe0ef[136]]&& _0x4278x27[_0xe0ef[137]]){logger[_0xe0ef[63]](_0xe0ef[129]+ _0x4278x27[_0xe0ef[55]]+ _0xe0ef[138]);execRequest(_0x4278x1f[_0xe0ef[131]],_0x4278x27[_0xe0ef[136]],_0x4278x27[_0xe0ef[137]])};break;case _0xe0ef[89]:if(_0x4278x27[_0xe0ef[139]]&& _0x4278x27[_0xe0ef[140]]){logger[_0xe0ef[63]](_0xe0ef[129]+ _0x4278x27[_0xe0ef[55]]+ _0xe0ef[141]);execRequest(_0x4278x1f[_0xe0ef[131]],_0x4278x27[_0xe0ef[139]],_0x4278x27[_0xe0ef[140]])};break;default:logger[_0xe0ef[71]](_0xe0ef[142])}};module[_0xe0ef[143]]= Custom
\ No newline at end of file