OverviewFilesCommitsIssuesDocsReleasesPeers

holepunchto-deps / @holepunchto / keet-store / store / chat / reaction / chat-reaction.saga.js

1 lines · javascript ref:
(function(_0x2021d6,_0x57cfd4){const _0x4e3b18={_0x3fc659:0x2f5,_0x2521d8:0x311,_0x3e2e18:0x2f3,_0x41f7c9:0x247,_0xa4b9d1:0x257,_0x4b31f8:0x262,_0x55b6bb:0x254,_0x3352b6:0x264,_0x511890:0x25a,_0x1b665b:0x28a,_0x220253:0x279,_0x5be731:0x265,_0x54bff6:0x27f,_0x2c518c:0x31b,_0x208917:0x315,_0x3f811f:0x30f,_0x1f3e20:0x270,_0x2c214f:0x264,_0x81847a:0x25d,_0x16da7b:0x247,_0x4bb2ac:0x255,_0x1a24d2:0x301,_0x1d7752:0x2f7,_0x530def:0x302,_0x466be5:0x268,_0x388cc8:0x270,_0x2952e0:0x27d,_0x451a53:0x267,_0x2f5c62:0x26a,_0x37b933:0x270},_0x5ada80={_0x8eff5:0x1ac};function _0xfa281f(_0x5e90d8,_0x5bba24,_0x5aaf1e,_0xe31d5d){return _0x5345(_0xe31d5d-0x241,_0x5aaf1e);}function _0x159e30(_0x5afa96,_0x423bc7,_0x50e2ef,_0xa50658){return _0x5345(_0x423bc7-_0x5ada80._0x8eff5,_0xa50658);}const _0x1724d0=_0x2021d6();while(!![]){try{const _0x1ccc23=parseInt(_0xfa281f(_0x4e3b18._0x3fc659,_0x4e3b18._0x2521d8,_0x4e3b18._0x3e2e18,0x303))/(-0x7*-0x349+0xa7c+-0x217a*0x1)*(-parseInt(_0x159e30(_0x4e3b18._0x41f7c9,_0x4e3b18._0xa4b9d1,0x26c,_0x4e3b18._0x4b31f8))/(-0x1f92+-0xbe1*-0x1+-0x1*-0x13b3))+parseInt(_0x159e30(_0x4e3b18._0x55b6bb,0x265,_0x4e3b18._0x3352b6,_0x4e3b18._0x511890))/(0xddb*0x1+-0x19b0*-0x1+0xb8*-0x37)+-parseInt(_0x159e30(_0x4e3b18._0x1b665b,_0x4e3b18._0x220253,_0x4e3b18._0x5be731,_0x4e3b18._0x54bff6))/(0x11*0x77+0x250+-0x175*0x7)+-parseInt(_0xfa281f(0x31a,_0x4e3b18._0x2c518c,_0x4e3b18._0x208917,_0x4e3b18._0x3f811f))/(0x2*-0x322+-0xe1a+0x1463)*(parseInt(_0x159e30(_0x4e3b18._0x1f3e20,_0x4e3b18._0x2c214f,_0x4e3b18._0x81847a,0x24f))/(0x2495*0x1+-0xfb7+-0x14d8))+-parseInt(_0x159e30(_0x4e3b18._0x16da7b,_0x4e3b18._0x4bb2ac,0x240,0x247))/(-0x137*0x1+0x20dd+-0x1f9f)*(parseInt(_0xfa281f(_0x4e3b18._0x1a24d2,0x2f5,_0x4e3b18._0x1d7752,_0x4e3b18._0x530def))/(-0x1831*0x1+0x1*0x33b+0x14fe))+parseInt(_0x159e30(_0x4e3b18._0x466be5,_0x4e3b18._0x388cc8,_0x4e3b18._0x2952e0,_0x4e3b18._0x451a53))/(-0x2155+0x81*-0x2a+0x574*0xa)+parseInt(_0x159e30(0x271,_0x4e3b18._0x2f5c62,0x27b,_0x4e3b18._0x37b933))/(-0x2503+-0x47*-0x5d+0xb42);if(_0x1ccc23===_0x57cfd4)break;else _0x1724d0['push'](_0x1724d0['shift']());}catch(_0x5a2ca7){_0x1724d0['push'](_0x1724d0['shift']());}}}(_0x592a,0x4adf4*-0x1+-0x256*-0x15b+0x90579));const _0x383e6d=(function(){const _0x375bab={_0x3b9172:0x127,_0xdfa6e:0x11f};let _0x43c326=!![];return function(_0x3e23a5,_0x5d6c92){const _0x2cac1e={_0x23f011:0x6a},_0x451159=_0x43c326?function(){function _0x3ed919(_0x61be98,_0x190ec1,_0x1c1fd3,_0x2dcceb){return _0x5345(_0x1c1fd3-_0x2cac1e._0x23f011,_0x2dcceb);}if(_0x5d6c92){const _0xeea17f=_0x5d6c92[_0x3ed919(0x113,_0x375bab._0x3b9172,_0x375bab._0xdfa6e,0x121)](_0x3e23a5,arguments);return _0x5d6c92=null,_0xeea17f;}}:function(){};return _0x43c326=![],_0x451159;};}()),_0x40d21e=_0x383e6d(this,function(){const _0x11569c={_0xdf1a73:0x192,_0x5ea457:0x17c,_0xa8c272:0x185,_0x3887bd:0x239,_0xa1cffe:0x23a,_0x4281b0:0x24d,_0x40ff6c:0x245,_0x4c4a4d:0x199,_0x42be76:0x22b,_0x49d224:0x24a,_0x32b56e:0x22e},_0x39267f={_0x1e9860:0xdc},_0x4d2bb6={_0x162843:0x2f9};function _0x36d8ae(_0x742279,_0xee6483,_0x14d440,_0x777dd9){return _0x5345(_0x742279- -_0x4d2bb6._0x162843,_0xee6483);}function _0x459821(_0xc55f2d,_0x338f57,_0x29d44b,_0x1181ed){return _0x5345(_0x1181ed-_0x39267f._0x1e9860,_0x338f57);}return _0x40d21e[_0x459821(_0x11569c._0xdf1a73,_0x11569c._0x5ea457,_0x11569c._0xa8c272,0x18b)]()[_0x36d8ae(-_0x11569c._0x3887bd,-_0x11569c._0xa1cffe,-_0x11569c._0x4281b0,-_0x11569c._0x40ff6c)]('(((.+)+)+)'+'+$')['toString']()[_0x459821(0x1a5,0x1a2,_0x11569c._0x4c4a4d,0x1ac)+'r'](_0x40d21e)[_0x36d8ae(-0x239,-_0x11569c._0x42be76,-_0x11569c._0x49d224,-_0x11569c._0x32b56e)]('(((.+)+)+)'+'+$');});_0x40d21e();import{select,put,takeLatest,takeEvery}from'redux-saga/effects';import{getCoreBackend}from'../../../backend';import{apiCall}from'../../../api/core';import{taskErrorSaga}from'../../error';import{getChatConfig}from'../init';function _0x5345(_0x5a398b,_0x217781){const _0x1bd650=_0x592a();return _0x5345=function(_0x506e82,_0x2a79f2){_0x506e82=_0x506e82-(0x1*-0x5f3+0x2063*0x1+0x1*-0x19c7);let _0x43c326=_0x1bd650[_0x506e82];return _0x43c326;},_0x5345(_0x5a398b,_0x217781);}import{CHAT_MESSAGE_REPORT_REACTION}from'../chat.constant';import{getCoreId}from'../message';import{getChatMessageCoreIdById}from'../list-view';function _0x592a(){const _0x315754=['ReportHand','search','1864rHltBl','1MEdscC','getLatestR','1831950dEKaig','onMemberLo','incompatib','push','filter','removeReac','le\x20message','addChatRep','addReactio','3751756gewanC','135YpLczU','\x20id','constructo','reportMemb','16583ZonlTU','chatMessag','487726ztzavy','chatReacti','eReportHan','deviceId','toString','length','payload','tion','adSaga','dler','apply','now','includes','62784NDxLvs','1549782acSKwQ','string','eactions','ort','chatMember','17882180mGmMgS'];_0x592a=function(){return _0x315754;};return _0x592a();}import{askChatReactionMembersCmd,reportChatMemberSuccess,reportChatMessageSuccess,setChatReactionMembers,toggleReactionCmd}from'./chat-reaction.action';import{getChatReactionsById}from'./chat-reaction.selector';import{reloadMessagesCmd}from'../list-view/list-view-data.action';import{getPreferencesNoChatRateLimit}from'../../preferences';let reactionReactionTimestamps=[];export function*isSendReactionRateLimited(){const _0x5b5425={_0xf74a91:0x18f,_0x39779d:0x18e,_0xdaf16a:0x18b,_0x426921:0x1ad,_0x5ab6ea:0x1a7,_0x470769:0x1a0,_0x2d10ef:0x1b9,_0x238f16:0x1c3,_0x2c2cfc:0x1b1,_0x3b1a3a:0x1ba,_0x2cf955:0x1a1,_0x1abb66:0x1b5},_0x11bc6a={_0x51678d:0x257},_0x3c3527={_0x28dda6:0x281},{reactionRateLimit:_0x2122d9,reactionRateLimitInterval:_0xe97e15}=yield select(getChatConfig),_0x261a33=yield select(getPreferencesNoChatRateLimit);if(_0x261a33)return![];function _0x14569e(_0xf53a,_0x14d90c,_0x3482c1,_0x37646c){return _0x5345(_0x37646c- -_0x3c3527._0x28dda6,_0x3482c1);}const _0xc62fb0=Date['now']()-_0xe97e15;reactionReactionTimestamps=reactionReactionTimestamps[_0x747ffa(-0x191,-_0x5b5425._0xf74a91,-_0x5b5425._0x39779d,-_0x5b5425._0xdaf16a)](_0x50c471=>_0x50c471>_0xc62fb0);function _0x747ffa(_0x3870b3,_0x1541c6,_0x1d00b2,_0x5b625c){return _0x5345(_0x1541c6- -_0x11bc6a._0x51678d,_0x5b625c);}if(reactionReactionTimestamps[_0x747ffa(-_0x5b5425._0x426921,-_0x5b5425._0x5ab6ea,-_0x5b5425._0x470769,-_0x5b5425._0x2d10ef)]>=_0x2122d9)return!![];return reactionReactionTimestamps[_0x14569e(-_0x5b5425._0x238f16,-0x1ab,-_0x5b5425._0x2c2cfc,-_0x5b5425._0x3b1a3a)](Date[_0x747ffa(-0x1b1,-_0x5b5425._0x2cf955,-0x1af,-_0x5b5425._0x1abb66)]()),![];}export function*toggleReactionSaga(_0x3b7d7f,_0x532085){const _0x195f54={_0x827ff8:0x2d5,_0x14876c:0x2d6,_0x34eeaa:0x2cb,_0x7a214f:0x11b,_0x3c71f1:0x119,_0x9cf97d:0x111,_0x3ff84d:0xf7,_0x27e743:0xeb,_0x4c2ced:0xff,_0x5b7338:0x10d,_0x3ce313:0x111,_0x565053:0x123,_0x896f7:0x116,_0xeecd44:0xf9,_0x572240:0x107},_0x529884={_0x17787b:0x1c8},_0x566c89={_0x212b78:0x225};function _0x227429(_0x437083,_0x408969,_0x45e8b2,_0x149920){return _0x5345(_0x408969-_0x566c89._0x212b78,_0x45e8b2);}const _0x37461b=yield isSendReactionRateLimited();if(_0x37461b)return;function _0x3514c1(_0x82f0d7,_0x207990,_0x2138dd,_0x47600d){return _0x5345(_0x47600d- -_0x529884._0x17787b,_0x207990);}try{const {text:_0x4c8bfc,messageId:_0x324289}=_0x532085[_0x227429(_0x195f54._0x827ff8,_0x195f54._0x14876c,_0x195f54._0x34eeaa,0x2e6)],_0x2a7def=getCoreId(_0x324289),{mine:_0x22cd32}=yield select(getChatReactionsById(_0x324289)),_0x40bc8a=getCoreBackend();_0x22cd32[_0x3514c1(-_0x195f54._0x7a214f,-_0x195f54._0x3c71f1,-0x10d,-_0x195f54._0x9cf97d)](_0x4c8bfc)?yield apiCall(_0x40bc8a[_0x3514c1(-_0x195f54._0x3ff84d,-_0x195f54._0x27e743,-0x10b,-_0x195f54._0x4c2ced)+_0x3514c1(-_0x195f54._0x5b7338,-_0x195f54._0x3ce313,-_0x195f54._0x565053,-_0x195f54._0x896f7)],_0x3b7d7f,_0x2a7def,_0x4c8bfc):yield apiCall(_0x40bc8a[_0x3514c1(-_0x195f54._0x5b7338,-_0x195f54._0xeecd44,-_0x195f54._0x572240,-0xfc)+'n'],_0x3b7d7f,_0x2a7def,_0x4c8bfc);}catch(_0x5b930b){yield taskErrorSaga('toggleReac'+'tionSaga',_0x5b930b);}}export function*chatMessageReportHandler({roomId:_0x2ee623,useLabelsFeature:_0x208187},_0x52197a){const _0x67b2d6={_0x1e5132:0x61,_0x534215:0x57,_0x251b41:0x54,_0x3e8da8:0x4a,_0x1a2dca:0x44,_0x2b67d9:0x54,_0x2065be:0x59,_0x2f7f6f:0x64,_0x156086:0x74,_0x1f1132:0x62,_0x3f7c9c:0x60,_0x4aacd1:0x55,_0x4fd758:0x64,_0x4d2252:0x5e,_0x2902e7:0x65,_0x362069:0x58,_0x435b2b:0x5a,_0x295a74:0x49,_0x5df6d7:0x39,_0x118cf1:0x45,_0x519c9d:0x4d,_0x8f8a5c:0x4b,_0x17f3a3:0x3f,_0x439160:0x47,_0x5e765e:0x4d,_0x420b7a:0x44},_0x2095ed={_0x15574b:0x67},_0x178b6f={_0x44827d:0x62};function _0x398d81(_0x4050df,_0x4a4353,_0x3b8a74,_0x10bc31){return _0x5345(_0x3b8a74- -_0x178b6f._0x44827d,_0x10bc31);}function _0x35b4da(_0x2177b8,_0x4fc129,_0x5c1260,_0x4e1e4f){return _0x5345(_0x4fc129- -_0x2095ed._0x15574b,_0x5c1260);}try{const {messageId:_0x418a03,memberId:_0x5336b1}=_0x52197a[_0x398d81(_0x67b2d6._0x1e5132,_0x67b2d6._0x534215,0x4f,_0x67b2d6._0x251b41)],_0x25d7aa=yield select(_0x11f443=>getChatMessageCoreIdById(_0x11f443,_0x418a03));if(!_0x25d7aa[_0x398d81(_0x67b2d6._0x3e8da8,_0x67b2d6._0x1a2dca,0x4c,_0x67b2d6._0x2b67d9)])throw new Error(_0x398d81(0x6a,_0x67b2d6._0x2065be,_0x67b2d6._0x2f7f6f,_0x67b2d6._0x156086)+_0x398d81(_0x67b2d6._0x1f1132,_0x67b2d6._0x3f7c9c,0x68,_0x67b2d6._0x4aacd1)+_0x398d81(_0x67b2d6._0x4fd758,_0x67b2d6._0x4d2252,0x6d,0x75));const _0x3926c9=getCoreBackend();_0x208187?yield apiCall(_0x3926c9[_0x35b4da(_0x67b2d6._0x2902e7,_0x67b2d6._0x4fd758,0x78,0x5f)+_0x398d81(_0x67b2d6._0x362069,_0x67b2d6._0x2065be,_0x67b2d6._0x435b2b,_0x67b2d6._0x4fd758)],_0x2ee623,_0x25d7aa):(yield apiCall(_0x3926c9['addReactio'+'n'],_0x2ee623,_0x25d7aa,CHAT_MESSAGE_REPORT_REACTION),yield put(reloadMessagesCmd())),yield put(reportChatMessageSuccess({'messageId':_0x418a03,'memberId':_0x5336b1}));}catch(_0x2f909d){yield taskErrorSaga(_0x398d81(_0x67b2d6._0x295a74,_0x67b2d6._0x5df6d7,0x48,_0x67b2d6._0x4aacd1)+_0x398d81(_0x67b2d6._0x118cf1,_0x67b2d6._0x519c9d,_0x67b2d6._0x8f8a5c,_0x67b2d6._0x17f3a3)+_0x35b4da(_0x67b2d6._0x439160,_0x67b2d6._0x5e765e,_0x67b2d6._0x420b7a,0x61),_0x2f909d);}}export function*chatMemberReportHandler({roomId:_0xc7eac},_0x51822a){const _0x49d15a={_0x408c36:0x1ab,_0x38d959:0x1a0,_0x48c3c9:0x31d,_0x237d21:0x313,_0x436670:0x18f,_0x2e3c88:0x196,_0x3899f0:0x1a8,_0x11d921:0x31c,_0x3fb8ce:0x332,_0x5b26e8:0x325,_0xcf5e78:0x32c},_0x4ebd69={_0x4114ad:0x3e4},_0x3df530={_0x2bd2f1:0x25c};function _0xe9cdf9(_0x120ce8,_0x4b59e4,_0x3bc000,_0x450a34){return _0x5345(_0x4b59e4- -_0x3df530._0x2bd2f1,_0x450a34);}function _0x54da1c(_0x39e1db,_0x2a0481,_0x5201b6,_0x309e5c){return _0x5345(_0x5201b6- -_0x4ebd69._0x4114ad,_0x2a0481);}try{const {memberId:_0x5875e0}=_0x51822a[_0xe9cdf9(-_0x49d15a._0x408c36,-0x1ab,-0x1bf,-_0x49d15a._0x38d959)],_0x20fa00=getCoreBackend();yield apiCall(_0x20fa00[_0x54da1c(-0x327,-_0x49d15a._0x48c3c9,-_0x49d15a._0x237d21,-0x301)+'er'],_0xc7eac,_0x5875e0),yield put(reportChatMemberSuccess({'roomId':_0xc7eac,'memberId':_0x5875e0}));}catch(_0x5b6c84){yield taskErrorSaga(_0xe9cdf9(-_0x49d15a._0x436670,-0x19f,-_0x49d15a._0x2e3c88,-_0x49d15a._0x3899f0)+_0x54da1c(-_0x49d15a._0x11d921,-_0x49d15a._0x3fb8ce,-_0x49d15a._0x5b26e8,-_0x49d15a._0xcf5e78)+'ler',_0x5b6c84);}}export function*chatReactionMemberLoadSaga({roomId:_0x1c240c},{payload:_0x2bebdf}){const _0x318913={_0x542d97:0x149,_0x5c3486:0x141,_0x7b10fa:0x14e,_0x4a744a:0x144,_0x38fc23:0x156,_0x135faa:0x2ec,_0x5ba093:0x2ec,_0x213521:0x308,_0x58517b:0x2e0,_0x13c7d1:0x2e1,_0x1fc46d:0x2e1,_0x11c578:0x14a,_0x3c85c3:0x15e,_0x14becb:0x160},_0x24c4d8={_0x24b180:0x211};function _0x4cbe65(_0x4b15d0,_0x56cf8b,_0x531b29,_0x4e04aa){return _0x5345(_0x531b29- -_0x24c4d8._0x24b180,_0x56cf8b);}function _0x2eede5(_0x1083ea,_0x2f790b,_0x50b5bc,_0x1b1e5e){return _0x5345(_0x2f790b- -0x3b4,_0x50b5bc);}const {messageId:_0x132b91,id:_0x327117}=_0x2bebdf,_0x85c68f=getCoreBackend();try{const _0x3b3280=getCoreId(_0x132b91),_0x1ffb98=yield apiCall(_0x85c68f[_0x4cbe65(-_0x318913._0x542d97,-_0x318913._0x5c3486,-_0x318913._0x7b10fa,-_0x318913._0x4a744a)+_0x4cbe65(-0x157,-0x152,-_0x318913._0x38fc23,-0x163)],_0x1c240c,_0x3b3280,_0x327117),_0x16538e=_0x1ffb98['map'](_0x497278=>_0x497278['sender'])[_0x2eede5(-_0x318913._0x135faa,-0x2ec,-0x2f7,-_0x318913._0x5ba093)](_0x34f554=>typeof _0x34f554===_0x4cbe65(-0x147,-0x145,-0x157,-0x159)&&!!_0x34f554);yield put(setChatReactionMembers({'id':_0x327117,'messageId':_0x132b91,'memberIds':_0x16538e}));}catch(_0x1caf96){yield taskErrorSaga(_0x2eede5(-0x306,-_0x318913._0x213521,-0x319,-0x307)+_0x2eede5(-_0x318913._0x58517b,-0x2ef,-_0x318913._0x13c7d1,-_0x318913._0x1fc46d)+_0x4cbe65(-_0x318913._0x11c578,-0x167,-_0x318913._0x3c85c3,-_0x318913._0x14becb),_0x1caf96);}}export function*chatReactionSaga({roomId:_0x5398b6}){yield takeLatest(toggleReactionCmd,toggleReactionSaga,_0x5398b6),yield takeEvery(askChatReactionMembersCmd,chatReactionMemberLoadSaga,{'roomId':_0x5398b6});}