OverviewFilesCommitsIssuesDocsReleasesPeers

holepunchto-deps / @holepunchto / keet-store / store / room / main / room-common.saga.js

1 lines · javascript ref:
(function(_0x4820c9,_0x58c288){const _0x53c016={_0x11e807:0x530,_0x356223:0x53d,_0x2893ba:0x52c,_0x5b418d:0x528,_0x49090a:0x52e,_0x3efb09:0x529,_0xc2669c:0x544,_0x128550:0x535,_0x181f4e:0x53a,_0xe26855:0x48,_0x16b814:0x44,_0x31f852:0x2d,_0x16a246:0x549,_0x4d33f8:0x545,_0x5d9b19:0x548,_0x4bef69:0x547,_0x203cdc:0x53f,_0x29ea88:0x53d,_0x19c85d:0x53c,_0x1ea6d6:0x542,_0x1b27e5:0x540,_0xea1a1c:0x53e,_0x289bb4:0x54c,_0x215219:0x54d,_0x27e443:0x1d,_0x5e286a:0x23,_0xab292e:0x33,_0x59fdb4:0x2b,_0x23f2ef:0x52c},_0x161ce9={_0x4efd7e:0x398},_0x2219a3={_0x1cb6ff:0x1c7};function _0x45031e(_0x3b2fa1,_0xb11186,_0x4bc9ca,_0x2e52ef){return _0x5c6e(_0xb11186- -_0x2219a3._0x1cb6ff,_0x4bc9ca);}function _0x49d28f(_0x225f6a,_0x2ca353,_0x4099a3,_0x2977c6){return _0x5c6e(_0x2ca353-_0x161ce9._0x4efd7e,_0x225f6a);}const _0x715756=_0x4820c9();while(!![]){try{const _0x1fee4b=parseInt(_0x49d28f(0x533,_0x53c016._0x11e807,_0x53c016._0x356223,_0x53c016._0x2893ba))/(0x25a0+-0xa*0x5d+-0x21fd)+parseInt(_0x49d28f(0x536,_0x53c016._0x5b418d,_0x53c016._0x49090a,_0x53c016._0x3efb09))/(0x1ad5*-0x1+0x801+-0x96b*-0x2)*(parseInt(_0x49d28f(_0x53c016._0xc2669c,_0x53c016._0x128550,0x527,_0x53c016._0x181f4e))/(-0x23ab+0x1*-0x244e+0x4*0x11ff))+-parseInt(_0x45031e(-_0x53c016._0xe26855,-0x39,-_0x53c016._0x16b814,-_0x53c016._0x31f852))/(-0x340+0x217d+-0x1e39)*(parseInt(_0x49d28f(_0x53c016._0x16a246,_0x53c016._0x4d33f8,_0x53c016._0x5d9b19,_0x53c016._0x4bef69))/(0x6d9*-0x3+0x1de4+-0x3*0x31c))+parseInt(_0x49d28f(_0x53c016._0x203cdc,_0x53c016._0x29ea88,_0x53c016._0x19c85d,_0x53c016._0x1ea6d6))/(0x3a2+-0x158a+0x11ee)+parseInt(_0x49d28f(_0x53c016._0x1b27e5,_0x53c016._0xea1a1c,_0x53c016._0x289bb4,_0x53c016._0x215219))/(-0x1943+0x2294+-0x94a)+-parseInt(_0x45031e(-_0x53c016._0x27e443,-_0x53c016._0x5e286a,-_0x53c016._0xab292e,-_0x53c016._0x59fdb4))/(0x1211+0x3*-0x55e+-0x1ef)+-parseInt(_0x49d28f(_0x53c016._0x23f2ef,0x538,_0x53c016._0x11e807,_0x53c016._0x203cdc))/(0xeb*0x14+0xd3d+-0x4*0x7e4);if(_0x1fee4b===_0x58c288)break;else _0x715756['push'](_0x715756['shift']());}catch(_0x4a25e0){_0x715756['push'](_0x715756['shift']());}}}(_0x2fe0,-0x2dba2+-0x104*-0xc7+0x42584));const _0x1081bc=(function(){const _0x2baffd={_0x54bf42:0x22,_0x1f220f:0x23,_0x2dad58:0x20};let _0x493ea6=!![];return function(_0x3a0229,_0x32d348){const _0x4c6e23={_0x4aed3b:0x1bb},_0x9dc6ac=_0x493ea6?function(){function _0x14615c(_0x41f7b4,_0x31107e,_0x3c0d1a,_0x2b2866){return _0x5c6e(_0x41f7b4- -_0x4c6e23._0x4aed3b,_0x31107e);}if(_0x32d348){const _0xd78c4=_0x32d348[_0x14615c(-_0x2baffd._0x54bf42,-0x1d,-_0x2baffd._0x1f220f,-_0x2baffd._0x2dad58)](_0x3a0229,arguments);return _0x32d348=null,_0xd78c4;}}:function(){};return _0x493ea6=![],_0x9dc6ac;};}()),_0x1fdf4f=_0x1081bc(this,function(){const _0x369bd7={_0x15161b:0x4bd,_0x3a33ff:0x4a4,_0x51cfc0:0x49d,_0x41a035:0x49a,_0x2e3cea:0x4ad,_0x493fa0:0x4b4,_0x182ad7:0x1bc,_0x2760ad:0x1c1,_0x2f1917:0x1b4,_0x559401:0x1ba},_0xca0fc0={_0x485e93:0x309};function _0x6c8374(_0x43e077,_0x40c8ae,_0x5236f2,_0x222076){return _0x5c6e(_0x5236f2-0x8,_0x40c8ae);}function _0x42c096(_0x1e3522,_0x2f82fe,_0x393953,_0x3680f1){return _0x5c6e(_0x393953-_0xca0fc0._0x485e93,_0x1e3522);}return _0x1fdf4f[_0x42c096(0x4a5,_0x369bd7._0x15161b,0x4b4,0x4c5)]()[_0x42c096(_0x369bd7._0x3a33ff,0x492,_0x369bd7._0x51cfc0,_0x369bd7._0x41a035)]('(((.+)+)+)'+'+$')[_0x42c096(0x4a5,_0x369bd7._0x2e3cea,_0x369bd7._0x493fa0,0x4bd)]()['constructo'+'r'](_0x1fdf4f)['search'](_0x6c8374(_0x369bd7._0x182ad7,_0x369bd7._0x2760ad,_0x369bd7._0x2f1917,_0x369bd7._0x559401)+'+$');});_0x1fdf4f();import{fork,takeLatest,takeLeading,getContext,put,call,select}from'redux-saga/effects';import{FEATURES,isFeatureSupported}from'@holepunchto/keet-schemas/versions';import{channel,buffers}from'redux-saga';import{getCoreBackend}from'../../../backend';import{apiCall}from'../../../api/core';import{chatSaga,chatFilePendingSaga,chatMembersBlockedHandler}from'../../chat';import{memberSaga,memberAllSubscriptionSaga,MEMBER_ROLE,getMemberItemById}from'../../member';function _0x5c6e(_0x658604,_0x2447b3){const _0x501efa=_0x2fe0();return _0x5c6e=function(_0x34739b,_0x1827e0){_0x34739b=_0x34739b-(-0x1d*0x4f+-0x174d+0x21cd*0x1);let _0x422fd1=_0x501efa[_0x34739b];return _0x422fd1;},_0x5c6e(_0x658604,_0x2447b3);}import{memberListSaga}from'../../member-list';import{taskErrorSaga}from'../../error';import{createInvitationSaga,createRoomInvitation}from'../joint';import{subscribeToRoomInfo}from'../room-info.saga';import{setMainRoomTipSize,getFirstTimeRoomModal}from'./room-main.reducer';import{updateRoomCapabilitiesInfo}from'../room-capabilities.saga';import{roomVersionGate,subscribeRoomVersion}from'../room-version.saga';import{roomInfoSaga}from'./room-info.saga';import{ROOM_TYPE}from'../room.constant';import{PLATFORM_CONTEXT_KEY}from'../../constants';import{isBlockedMembersDataEvt}from'../../identity/member';import{throttleFileStatsChanged}from'../../media/file/saga/file.saga';import{memberChangeRoleSubmit,myMemberRemoved}from'../../member/member.reducer';import{setFirstTimeRoomModal,closeFirstTimeRoomModal,closeRoomSubmit}from'../room.action';function _0x2fe0(){const _0x7e88fe=['isMuted','commonRoom','search','getTipSize','CHAT_LABEL','isOpen','207339sbZbQn','apply','unindexede','roomId','expanding','118845jdcYBb','dRoomTipSa','SG_INDEX','725796WSmPcq','ADMIN','BROADCAST','Saga','1603904BlDSIr','1363326tsQtif','786380rowKkX','payload','firstTimeR','oomModalSa','MUTE_MEMBE','toString','(((.+)+)+)','845965UDsShs','MODERATOR','4shGeon','REPORTED_M','2WawpPL','EMBER_INDE'];_0x2fe0=function(){return _0x7e88fe;};return _0x2fe0();}import{PREFERENCES,preferenceUpdateTask,getPreferencesRoomIntroModalNeeded,getPreferencesIntroModalSeenRooms}from'../../preferences';import{forwardMessageToRoomSaga}from'../forward-message/forward-message.saga';import{reportedMessagesSaga}from'../../reported-messages';import{membersReportedSaga}from'../../member/reported';export function*unindexededRoomTipSaga(_0x8ccbf9){const _0x34f571={_0x5d16ec:0x3a8,_0x310c1e:0x3b7,_0x3ea11d:0x3ad,_0x485185:0x3a3,_0x4de514:0x3b3,_0x26365a:0x3bb,_0x17570d:0x3af};function _0x1744a2(_0x55ac0,_0x2574c0,_0x4055cb,_0xa893ff){return _0x5c6e(_0xa893ff-0x3a8,_0x55ac0);}function _0x4720ca(_0x315c6f,_0x5b6fea,_0x37c59d,_0x3039df){return _0x5c6e(_0x315c6f-0x213,_0x3039df);}try{const _0x14e7aa=getCoreBackend(),_0x3d0575=yield apiCall(_0x14e7aa[_0x4720ca(_0x34f571._0x5d16ec,_0x34f571._0x310c1e,0x39c,0x399)],_0x8ccbf9);yield put(setMainRoomTipSize(_0x3d0575));}catch(_0x4a51a8){yield taskErrorSaga(_0x4720ca(_0x34f571._0x3ea11d,_0x34f571._0x485185,_0x34f571._0x310c1e,_0x34f571._0x4de514)+_0x4720ca(0x3b1,_0x34f571._0x26365a,_0x34f571._0x17570d,_0x34f571._0x4de514)+'ga',_0x4a51a8);}}function*autoUnmuteOnPromotionSaga(_0x29e34b,_0x201cee){const _0x3a6ffd={_0x5e1b4a:0x4d8,_0x399c80:0x4cf,_0x5a0656:0x4c7,_0xfd8657:0x4bb,_0x1f0e86:0x4d6,_0x1097b8:0x4ce,_0x5b107e:0x4ca,_0x21f538:0x4ce,_0x20a73f:0x4c3,_0x90169:0x4c0};function _0xc2947e(_0x2afa51,_0x5f465b,_0xc94ccb,_0x54bfb5){return _0x5c6e(_0x2afa51- -0x1ee,_0x54bfb5);}const {role:_0x3f19d3,memberId:_0x12aae6}=_0x201cee[_0x5eabbb(0x4e6,0x4da,_0x3a6ffd._0x5e1b4a,_0x3a6ffd._0x399c80)];function _0x5eabbb(_0x4f067d,_0xcf340d,_0x3c0868,_0x308748){return _0x5c6e(_0x3c0868-0x331,_0xcf340d);}const _0x2f8b02=_0x3f19d3===MEMBER_ROLE[_0x5eabbb(0x4bf,_0x3a6ffd._0x5a0656,0x4be,_0x3a6ffd._0xfd8657)]||_0x3f19d3===MEMBER_ROLE[_0x5eabbb(0x4d6,_0x3a6ffd._0x1f0e86,0x4d2,_0x3a6ffd._0x1097b8)];if(_0x2f8b02){const _0x2dc489=yield select(getMemberItemById(_0x29e34b,_0x12aae6));if(!_0x2dc489?.[_0x5eabbb(_0x3a6ffd._0x5b107e,_0x3a6ffd._0x21f538,_0x3a6ffd._0x20a73f,_0x3a6ffd._0x90169)])return;const _0x2ac0e5=getCoreBackend();yield apiCall(_0x2ac0e5['unmuteMemb'+'er'],_0x29e34b,_0x12aae6);}}function*closeRoomOnRemoveSaga(_0x3e9e50,_0x149012){const _0x3be49a={_0x508357:0x4de,_0x15a1e9:0x4e0,_0x5cbc6e:0x4d0},_0x325487={_0x31042d:0x329},{roomId:_0x58df33}=_0x149012[_0x8af588(_0x3be49a._0x508357,0x4e0,_0x3be49a._0x15a1e9,_0x3be49a._0x5cbc6e)];function _0x8af588(_0x8bed7b,_0x42014a,_0x50fa66,_0x399798){return _0x5c6e(_0x399798-_0x325487._0x31042d,_0x8bed7b);}_0x58df33===_0x3e9e50&&(yield put(closeRoomSubmit({'openNextRoom':!![]})));}function*firstTimeRoomModalSaga({roomId:_0x27a92d}){const _0x1c599c={_0x3bb845:0x429,_0x4d4d41:0x434,_0x560afd:0x432,_0x170266:0x4d2,_0x1f103c:0x4c9,_0x33560a:0x4e7,_0x426c62:0x440,_0x130bb0:0x450,_0x4b0bb2:0x440,_0xf7fbf8:0x443,_0x32f881:0x4e5,_0xa2e8af:0x4ea,_0x4c98e1:0x4d6,_0x19fa2a:0x4e1},_0x483e8b={_0x3bf76b:0x29b};function _0x4b8652(_0x543e58,_0x1a7e9c,_0x366e16,_0x2fabe2){return _0x5c6e(_0x2fabe2-_0x483e8b._0x3bf76b,_0x543e58);}function _0x491e59(_0x342975,_0x4125be,_0x39f64e,_0x36c7d9){return _0x5c6e(_0x342975-0x33c,_0x36c7d9);}try{const _0x22f3ac=yield select(getFirstTimeRoomModal);(_0x22f3ac[_0x4b8652(_0x1c599c._0x3bb845,0x434,_0x1c599c._0x4d4d41,_0x1c599c._0x560afd)]||_0x22f3ac[_0x491e59(0x4d7,_0x1c599c._0x170266,_0x1c599c._0x1f103c,_0x1c599c._0x33560a)])&&(yield put(closeFirstTimeRoomModal()));const _0x4fd263=yield select(getPreferencesIntroModalSeenRooms);yield put(setFirstTimeRoomModal({'roomId':_0x27a92d,'isOpen':!![]}));const _0x2d4987={..._0x4fd263,[_0x27a92d]:!![]};yield call(preferenceUpdateTask,PREFERENCES['INTRO_MODA'+'L_SEEN_ROO'+'MS'],_0x2d4987);}catch(_0x188fe8){yield taskErrorSaga(_0x4b8652(_0x1c599c._0x426c62,_0x1c599c._0x130bb0,_0x1c599c._0x4b0bb2,_0x1c599c._0xf7fbf8)+_0x491e59(_0x1c599c._0x32f881,_0x1c599c._0xa2e8af,_0x1c599c._0x4c98e1,_0x1c599c._0x19fa2a)+'ga',_0x188fe8);}}export function*commonRoomSaga(_0x47c586){const _0x5abacf={_0x13eb92:0xa7,_0x1ba7af:0x99,_0x191dca:0xa3,_0xc31829:0x9a,_0x3c8ebd:0xa2,_0x1e1078:0x96,_0x3800de:0xaa,_0x5d173d:0x9b,_0x41bb50:0xb7,_0x382662:0x52,_0x527a13:0x9c,_0x191723:0x92,_0x2ba72f:0x9e,_0x20c0ea:0xad,_0x5668ae:0xb5,_0x2b4cd1:0xb2,_0x414f33:0xa1,_0x3a6522:0x90,_0x1ff6c2:0xb8,_0x3dfbff:0xb3,_0x41cf21:0x67,_0x54ae06:0x68,_0x21d16d:0x63,_0x524ab7:0x7b},_0x41c7c6={_0x31ca1d:0xf5},{roomId:_0x201043,myMemberId:_0x5c41b3,roomType:_0x38ecca,roomVersion:_0x3df7bf,messageId:_0x3f2aba,appVersion:_0x40b22e}=_0x47c586;function _0x5ce66b(_0x26cdea,_0x4eb621,_0x37d28c,_0x57d87e){return _0x5c6e(_0x57d87e- -0x130,_0x37d28c);}function _0x4fceef(_0x180b33,_0x4e3390,_0x33a876,_0x31f366){return _0x5c6e(_0x180b33- -_0x41c7c6._0x31ca1d,_0x33a876);}try{const {applicationKey:_0x1b8380,config:{pearProtocol:_0x2a15b7}}=yield getContext(PLATFORM_CONTEXT_KEY),_0x300d8c=yield call(channel,buffers[_0x4fceef(_0x5abacf._0x13eb92,_0x5abacf._0x1ba7af,_0x5abacf._0x191dca,0xa4)](-0x13ad+-0x45*-0x14+0xe5d));yield fork(throttleFileStatsChanged,_0x300d8c),yield fork(roomVersionGate(FEATURES[_0x4fceef(_0x5abacf._0xc31829,_0x5abacf._0x3c8ebd,_0x5abacf._0x1e1078,0x8d)+_0x4fceef(_0x5abacf._0x3800de,_0x5abacf._0x5d173d,_0x5abacf._0x41bb50,0xa5)],reportedMessagesSaga,[_0x201043,_0x5c41b3]),_0x201043),yield fork(roomVersionGate(FEATURES[_0x5ce66b(0x5f,0x70,_0x5abacf._0x382662,0x5f)+_0x4fceef(_0x5abacf._0x527a13,_0x5abacf._0x191723,_0x5abacf._0x2ba72f,0xa2)+'X'],membersReportedSaga,[_0x201043,_0x5c41b3]),_0x201043);const _0x1fe9fa=[],_0x2c727a=_0x38ecca===ROOM_TYPE[_0x4fceef(_0x5abacf._0x20c0ea,_0x5abacf._0x5668ae,_0x5abacf._0x2b4cd1,0xb2)],_0x2fb7da=isFeatureSupported(_0x3df7bf,FEATURES[_0x4fceef(_0x5abacf._0x414f33,0x95,_0x5abacf._0x3a6522,0xa9)+'S']);yield fork(chatSaga,{'roomId':_0x201043,'ignoreBlocked':_0x2c727a,'filterNames':_0x1fe9fa,'messageId':_0x3f2aba,'fileStatsChannel':_0x300d8c,'useLabelsFeature':_0x2fb7da}),yield fork(chatFilePendingSaga,{'roomId':_0x201043});const _0x5cbe2f=isFeatureSupported(_0x3df7bf,FEATURES[_0x4fceef(0xb5,0xbe,_0x5abacf._0x1ff6c2,_0x5abacf._0x3dfbff)+'R']);yield fork(updateRoomCapabilitiesInfo,{'roomId':_0x201043,'myMemberId':_0x5c41b3}),yield fork(memberSaga,{'roomId':_0x201043,'myMemberId':_0x5c41b3,'muteMemberSupported':_0x5cbe2f});_0x5cbe2f&&(yield takeLatest(memberChangeRoleSubmit,autoUnmuteOnPromotionSaga,_0x201043));yield takeLeading(createRoomInvitation,createInvitationSaga,{'applicationKey':_0x1b8380,'pearProtocol':_0x2a15b7}),yield takeLeading(myMemberRemoved,closeRoomOnRemoveSaga,_0x201043),yield fork(roomInfoSaga,{'roomId':_0x201043,'fileStatsChannel':_0x300d8c}),yield fork(subscribeToRoomInfo,{'roomId':_0x201043,'appVersion':_0x40b22e}),yield fork(subscribeRoomVersion,{'roomId':_0x201043,'appVersion':_0x40b22e}),yield takeLatest(isBlockedMembersDataEvt,chatMembersBlockedHandler),yield fork(unindexededRoomTipSaga,_0x201043),yield fork(memberListSaga,{'roomId':_0x201043}),yield fork(memberAllSubscriptionSaga,{'roomId':_0x201043});const _0x22306e=yield select(getPreferencesRoomIntroModalNeeded,_0x201043);_0x22306e&&(yield fork(firstTimeRoomModalSaga,{'roomId':_0x201043})),yield fork(forwardMessageToRoomSaga,{'appVersion':_0x40b22e});}catch(_0x32b14a){yield taskErrorSaga(_0x5ce66b(_0x5abacf._0x41cf21,_0x5abacf._0x54ae06,0x6d,_0x5abacf._0x21d16d)+_0x5ce66b(0x7e,0x7d,_0x5abacf._0x524ab7,0x73),_0x32b14a);}}