OverviewFilesCommitsIssuesDocsReleasesPeers

holepunchto-deps / @holepunchto / keet-store / store / call / call-dm.saga.js

1 lines · javascript ref:
(function(_0x2dcb00,_0x19c38a){const _0x48cce8={_0x5d48aa:0x2c2,_0x2495c1:0x2b9,_0x406bc1:0x2bb,_0x340a25:0x228,_0x9f9940:0x22b,_0x3831ba:0x2b5,_0x488c0d:0x2b1,_0x5b5a07:0x2b5,_0xd5ea5b:0x2bd,_0x38a369:0x2b0,_0x27f9d2:0x2b2,_0x31fe8e:0x2b6,_0x475211:0x23b,_0x296a56:0x22a,_0x324bb4:0x231,_0xba508c:0x243,_0x17cb50:0x238,_0x5df7ff:0x2b4,_0xf8142a:0x2ba,_0x572692:0x2c0,_0x1300e0:0x2c5,_0x4bbb49:0x23a,_0x312c16:0x239,_0x37d897:0x236,_0x387bc3:0x2c8,_0x509d99:0x2c7,_0x31be46:0x2be},_0x198242={_0x3eec0c:0xb0},_0x259232=_0x2dcb00();function _0x7aa37d(_0x406757,_0x28eed2,_0x217db7,_0x27aba7){return _0x2256(_0x217db7-_0x198242._0x3eec0c,_0x28eed2);}function _0x3c042c(_0x352dfb,_0x1b5fe8,_0x3be480,_0x1f6b76){return _0x2256(_0x3be480-0x141,_0x1b5fe8);}while(!![]){try{const _0x3391cc=-parseInt(_0x3c042c(0x2c2,_0x48cce8._0x5d48aa,_0x48cce8._0x2495c1,_0x48cce8._0x406bc1))/(0x23e3*-0x1+-0x261+0x2645*0x1)*(-parseInt(_0x7aa37d(_0x48cce8._0x340a25,0x239,0x22e,_0x48cce8._0x9f9940))/(-0x1228+-0x137d+0x25a7))+-parseInt(_0x3c042c(_0x48cce8._0x3831ba,_0x48cce8._0x488c0d,_0x48cce8._0x5b5a07,0x2af))/(0x2*0x12f9+0x23dd+0x1273*-0x4)*(parseInt(_0x3c042c(0x2c7,0x2bb,_0x48cce8._0x5d48aa,_0x48cce8._0xd5ea5b))/(0x777*-0x4+-0x2e*0x36+0x2794))+parseInt(_0x3c042c(_0x48cce8._0x38a369,0x2a9,_0x48cce8._0x27f9d2,_0x48cce8._0x31fe8e))/(-0x2*0x78b+-0x5e7*0x5+0x2c9e)*(-parseInt(_0x7aa37d(0x237,_0x48cce8._0x475211,0x230,_0x48cce8._0x296a56))/(-0x3*-0x82f+0x5f1+-0x32*0x9c))+parseInt(_0x7aa37d(_0x48cce8._0x324bb4,_0x48cce8._0xba508c,_0x48cce8._0x17cb50,_0x48cce8._0xba508c))/(-0x1a52+-0x844+0x229d)*(-parseInt(_0x3c042c(_0x48cce8._0x5df7ff,_0x48cce8._0xf8142a,_0x48cce8._0x572692,_0x48cce8._0x1300e0))/(0x15c7+0xece*0x2+-0x1*0x335b))+-parseInt(_0x3c042c(0x2ba,0x2c5,0x2bd,0x2bf))/(0x966+-0x23e3+0x7*0x3ca)+parseInt(_0x7aa37d(_0x48cce8._0x4bbb49,_0x48cce8._0x312c16,_0x48cce8._0x37d897,_0x48cce8._0x296a56))/(0x185d+-0x4c*0x1d+-0xfb7)+parseInt(_0x3c042c(0x2d1,_0x48cce8._0x387bc3,_0x48cce8._0x387bc3,0x2cf))/(-0x10f1+-0x1c9f+0x2d9b)*(parseInt(_0x3c042c(0x2ca,_0x48cce8._0x509d99,_0x48cce8._0x31be46,0x2be))/(0x2620+0x1ccd+-0x42e1));if(_0x3391cc===_0x19c38a)break;else _0x259232['push'](_0x259232['shift']());}catch(_0x3d2805){_0x259232['push'](_0x259232['shift']());}}}(_0x5410,-0x20f4f+0x4a630+0x367f));const _0x44071d=(function(){const _0x3f282b={_0x5c73d6:0x348};let _0x159fae=!![];return function(_0x2668b7,_0x54b227){const _0x1c535f=_0x159fae?function(){const _0x1527af={_0x3bce9e:0x1d8};function _0x25e1e9(_0xd2cac9,_0x1d773c,_0x4a7ce5,_0x2749e){return _0x2256(_0x2749e-_0x1527af._0x3bce9e,_0x1d773c);}if(_0x54b227){const _0x20ad2b=_0x54b227[_0x25e1e9(0x343,_0x3f282b._0x5c73d6,0x344,0x34b)](_0x2668b7,arguments);return _0x54b227=null,_0x20ad2b;}}:function(){};return _0x159fae=![],_0x1c535f;};}()),_0x25df39=_0x44071d(this,function(){const _0x5c71ad={_0x32b3f8:0x257,_0x15dfe5:0x25e,_0x5bc142:0x252,_0x42c1ee:0x25b,_0x254cd6:0x260,_0x2f1b21:0x254,_0x331d7f:0x263,_0x148d04:0x258,_0x519fcc:0x4cd,_0x277c7f:0x4bd},_0xc7d2e5={_0x451179:0x3d2};function _0x5b140e(_0x2c9c52,_0x14b628,_0x4ee236,_0x4248ed){return _0x2256(_0x2c9c52-0x353,_0x4ee236);}function _0x17a5a4(_0x18b5b2,_0x59ca1a,_0x26202e,_0xb798d){return _0x2256(_0xb798d- -_0xc7d2e5._0x451179,_0x26202e);}return _0x25df39[_0x17a5a4(-0x24c,-0x25b,-0x255,-_0x5c71ad._0x32b3f8)]()['search'](_0x17a5a4(-0x260,-_0x5c71ad._0x15dfe5,-_0x5c71ad._0x5bc142,-0x25c)+'+$')[_0x17a5a4(-0x259,-_0x5c71ad._0x42c1ee,-_0x5c71ad._0x254cd6,-_0x5c71ad._0x32b3f8)]()['constructo'+'r'](_0x25df39)[_0x17a5a4(-_0x5c71ad._0x2f1b21,-0x25e,-_0x5c71ad._0x331d7f,-_0x5c71ad._0x148d04)](_0x5b140e(0x4c9,_0x5c71ad._0x519fcc,0x4d3,_0x5c71ad._0x277c7f)+'+$');});_0x25df39();function _0x5410(){const _0x2886b8=['CALL_HANGU','handleDmCa','CALL_START','addCallMis','757510hIxMRQ','99AfsVnA','2516143kKenIb','70nJIvNf','SETTINGS','apply','87bxjpwJ','sedEvent','(((.+)+)+)','cline','15SdqveF','llNotifyEn','search','toString','2436948jShWgr','1340124nEePQm','17098SVwjDi','8eNWYSI','116778OTySlA','16928ksUoQK'];_0x5410=function(){return _0x2886b8;};return _0x5410();}import{put,select,takeLatest,take,all,getContext}from'redux-saga/effects';import{isSetCallSettingsReady,setCallSettingsReady}from'./call-settings.action';function _0x2256(_0x49bc9c,_0x3984ac){const _0x2b3313=_0x5410();return _0x2256=function(_0x5b41f7,_0x1d639d){_0x5b41f7=_0x5b41f7-(-0x6*-0x369+0x1c3*0x2+-0x168b);let _0x6ff018=_0x2b3313[_0x5b41f7];return _0x6ff018;},_0x2256(_0x49bc9c,_0x3984ac);}import{setCallStatus,callJoinCmd,increaseCallPeersCount,openCallSettings,callJoinDMIncoming,callDeclineDMIncoming,callNotificationReceived,callSetIncomingDMRoomId,callResetIncomingDMRoomId,decreaseCallPeersCount,callCancel,callVideoStreamToggle}from'./call.action';import{getCallPeersCount,getCallStatus,isCallJoinedMode,isCallReady,getCallIncomingDMRoomId}from'./call.reducer';import{CALL_STATUS,ENABLE_INCOMING_DM_CALL_NOTIFY,ENABLE_MISSED_CALL_EVENT}from'./call.constants';import{getMemberBlocked,getMyMemberId}from'../identity';import{getRoomMainId,getIsRoomDm,getRoomNotificationById,switchRoomSubmit,getRoomDmMemberId}from'../room';import{CHAT_MESSAGE_TYPE}from'../chat';import{getCoreBackend}from'../../backend';import{apiCall}from'../../api/core';import{taskErrorSaga}from'../error';import{getMyVideoMuted}from'./call-settings.reducer';import{getPreferencesNotificationsType,NOTIFICATIONS_TYPES}from'../preferences';import{ENV_CONTEXT_KEY}from'../constants';import{getUIAppBackgrounded,getUINativeCallRinging}from'../ui-mobile/ui.reducer';import{uiStartCall}from'../ui-mobile/ui.action';export function*handleDmCallNotifyDecline({payload:_0x3ecc97}){const _0x218b8a={_0x2b006e:0x170,_0x3c54b8:0x173,_0x369a08:0x178,_0x2bd649:0x160,_0x805bd8:0x163,_0x2d2495:0x161,_0x4dac49:0x300,_0x3f2dfd:0x2f6,_0x2d9df7:0x2fb,_0x225cbe:0x2f4,_0x2aa17d:0x2eb},_0x2cc302={_0x666757:0x17d};function _0x3fed64(_0x4ab217,_0x39d747,_0x19743e,_0x35bdb6){return _0x2256(_0x39d747-_0x2cc302._0x666757,_0x4ab217);}function _0x28ea77(_0x125e22,_0x373854,_0x4fd0d1,_0x5c909b){return _0x2256(_0x125e22- -0x15,_0x5c909b);}const {roomId:_0x576d63}=_0x3ecc97;try{yield put(callResetIncomingDMRoomId());if(ENABLE_MISSED_CALL_EVENT){const _0x11b51a=getCoreBackend();yield apiCall(_0x11b51a[_0x28ea77(_0x218b8a._0x2b006e,0x171,_0x218b8a._0x3c54b8,_0x218b8a._0x369a08)+_0x28ea77(_0x218b8a._0x2bd649,_0x218b8a._0x805bd8,0x159,_0x218b8a._0x2d2495)],_0x576d63);}}catch(_0x2c9290){yield taskErrorSaga(_0x3fed64(0x2fe,_0x218b8a._0x4dac49,_0x218b8a._0x3f2dfd,0x306)+'llNotifyDe'+_0x3fed64(_0x218b8a._0x2d9df7,0x2f4,_0x218b8a._0x225cbe,_0x218b8a._0x2aa17d),_0x2c9290);}}export function*handleDmCallNotifyEnd(_0x5aad34){const _0x57be6b={_0x16b95b:0x203,_0x3d842e:0x294,_0x3c2244:0x29d,_0x1570de:0x29c,_0xd1b9a4:0x29e},_0x27a336={_0xe5a552:0x11b},_0x41e16b={_0x54fd96:0x79};function _0x578243(_0x31ab77,_0x5331ff,_0x89216d,_0x567a7f){return _0x2256(_0x89216d-_0x41e16b._0x54fd96,_0x31ab77);}const _0x5c50a2=yield select(getCallIncomingDMRoomId);function _0x144db4(_0xeceb31,_0x50c9ec,_0x2a1e7f,_0x486274){return _0x2256(_0xeceb31-_0x27a336._0xe5a552,_0x486274);}if(_0x5c50a2===_0x5aad34)try{yield put(callResetIncomingDMRoomId());if(ENABLE_MISSED_CALL_EVENT){const _0x5019f9=getCoreBackend();yield apiCall(_0x5019f9[_0x578243(0x1fc,0x20a,0x1fe,_0x57be6b._0x16b95b)+'sedEvent'],_0x5aad34);}}catch(_0x3de9c0){yield taskErrorSaga('handleDmCa'+_0x144db4(_0x57be6b._0x3d842e,_0x57be6b._0x3c2244,_0x57be6b._0x1570de,_0x57be6b._0xd1b9a4)+'d',_0x3de9c0);}}export function*handleDmCallNotifyIncoming(_0x179229){const _0x49d0db={_0x29b881:0x32c,_0x3f8886:0x337,_0x557039:0x331},_0x3eb680={_0x2492c5:0x1ba};function _0x47c354(_0x837ce,_0x1e8ca9,_0x3c7053,_0xf586e6){return _0x2256(_0x837ce-_0x3eb680._0x2492c5,_0xf586e6);}const {isMobile:_0x3b0bb6}=yield getContext(ENV_CONTEXT_KEY),_0x4e9b13=yield select(getCallIncomingDMRoomId);if(_0x4e9b13)return;const _0xa7a947=yield select(getRoomNotificationById(_0x179229)),_0x588a42=yield select(getPreferencesNotificationsType),_0x1d2eaf=yield select(getRoomDmMemberId(_0x179229)),_0x243eed=yield select(_0x589617=>getMemberBlocked(_0x589617,_0x1d2eaf));if(!_0xa7a947||_0x588a42===NOTIFICATIONS_TYPES['NONE']||_0x243eed)return;const _0x452bda=yield select(getCallStatus);_0x452bda===CALL_STATUS[_0x47c354(_0x49d0db._0x29b881,_0x49d0db._0x3f8886,_0x49d0db._0x557039,0x336)]&&(yield put(callCancel()));if(_0x3b0bb6){const _0x36a1eb=yield select(getUIAppBackgrounded),_0x25ef94=yield select(getUINativeCallRinging);if(_0x36a1eb||_0x25ef94)return;}yield put(callSetIncomingDMRoomId({'roomId':_0x179229}));}export function*handleDmCallNotifyJoin({payload:_0x4a2f9f}){const {roomId:_0x52cf49,videoMuted:_0x488b82}=_0x4a2f9f,{isMobile:_0x416877}=yield getContext(ENV_CONTEXT_KEY),_0x4d395c=yield select(getCallIncomingDMRoomId),_0x1cd471=yield select(getRoomMainId);yield put(callResetIncomingDMRoomId());if(_0x1cd471!==_0x4d395c){yield put(switchRoomSubmit({'roomId':_0x52cf49}));while(!![]){yield take(setCallStatus);const _0x209742=yield select(getCallStatus);if(isCallReady(_0x209742))break;}}yield put(openCallSettings());while(!![]){const _0x32c0d2=yield take(setCallSettingsReady);if(isSetCallSettingsReady(_0x32c0d2))break;}const _0x1abdab=yield select(getMyVideoMuted);_0x1abdab!==_0x488b82&&(yield put(callVideoStreamToggle()));if(_0x416877){yield put(uiStartCall({'videoMuted':_0x1abdab,'answeringInAppCallRing':!![]}));return;}yield put(callJoinCmd());}export function*handleDmCallNotify({message:_0x4e6d26,roomId:_0x3adbba}){const _0x520a54={_0x3f19e2:0x191,_0xa164db:0x189,_0x22cc37:0x195,_0x482dd2:0x43a,_0xd97cce:0x431,_0x208d6b:0x442,_0x3871a6:0x436},_0x5cc27b={_0x49ac45:0x30d},_0x59b4e6={_0x3c9163:0x2b4},_0x4cc4af=yield select(getIsRoomDm(_0x3adbba)),_0x462eab=yield select(getCallStatus),_0x590820=isCallJoinedMode(_0x462eab);if(!_0x4cc4af||_0x590820)return;function _0x394974(_0x4d0d6f,_0x416139,_0x39d511,_0x218682){return _0x2256(_0x218682-_0x59b4e6._0x3c9163,_0x39d511);}function _0xf05c4(_0xbc38e0,_0x55936f,_0x95af02,_0x10d989){return _0x2256(_0x55936f- -_0x5cc27b._0x49ac45,_0xbc38e0);}const {memberId:_0x36eee3,event:{type:_0x4e9e97}}=_0x4e6d26,_0x312653=yield select(getMyMemberId);if(_0x312653===_0x36eee3)return;_0x4e9e97===CHAT_MESSAGE_TYPE[_0xf05c4(-_0x520a54._0x3f19e2,-_0x520a54._0xa164db,-_0x520a54._0x22cc37,-0x18e)+'ED']&&(yield handleDmCallNotifyIncoming(_0x3adbba)),_0x4e9e97===CHAT_MESSAGE_TYPE[_0x394974(_0x520a54._0x482dd2,_0x520a54._0xd97cce,_0x520a54._0x208d6b,_0x520a54._0x3871a6)+'P']&&(yield handleDmCallNotifyEnd(_0x3adbba));}export function*handleCallNotificationReceived({payload:_0x5e5cd0}){const {message:_0x5354b5,roomId:_0x7b1cb0}=_0x5e5cd0||{};if(!_0x5354b5||!_0x7b1cb0)return;yield handleDmCallNotify({'message':_0x5354b5,'roomId':_0x7b1cb0});}export function*handleIncreaseCallPeersCount({payload:_0xa5b004}){const {roomId:_0x2d17b0}=_0xa5b004,{isMobile:_0x3380a6}=yield getContext(ENV_CONTEXT_KEY),[_0x4a7eda,_0x5a3662,_0x1b75d8,_0x323b9c,_0x4f85ef]=yield all([select(getIsRoomDm(_0x2d17b0)),select(getCallIncomingDMRoomId),select(getCallPeersCount,_0x2d17b0),select(getRoomMainId),select(getCallStatus)]),_0x28b47c=isCallJoinedMode(_0x4f85ef);_0x4a7eda&&!_0x5a3662&&_0x2d17b0===_0x323b9c&&_0x1b75d8===-0x1*0x22d2+-0x20*0xa6+-0x29*-0x15b&&!_0x28b47c&&!_0x3380a6&&(yield handleDmCallNotifyIncoming(_0x2d17b0));if(!_0x4a7eda||!_0x5a3662)return;_0x4a7eda&&_0x5a3662&&_0x2d17b0===_0x5a3662&&_0x1b75d8>0x1cdf+0x1d2a+0x9ac*-0x6&&(yield put(callResetIncomingDMRoomId()));}export function*handleDecreaseCallPeersCount({payload:_0x3c34f7}){const {roomId:_0x1748a9}=_0x3c34f7,[_0x10aca2,_0x406b22,_0x51dcd6,_0x287bf6,_0xa79247]=yield all([select(getIsRoomDm(_0x1748a9)),select(getCallIncomingDMRoomId),select(getCallPeersCount,_0x1748a9),select(getRoomMainId),select(getCallStatus)]),_0x29f644=isCallJoinedMode(_0xa79247);_0x10aca2&&_0x406b22&&_0x406b22===_0x1748a9&&_0x1748a9===_0x287bf6&&_0x51dcd6===0x107*0x11+-0x1f7f+0xe08&&!_0x29f644&&(yield handleDmCallNotifyEnd(_0x1748a9));}export function*callDMSaga(){if(!ENABLE_INCOMING_DM_CALL_NOTIFY)return;yield takeLatest(increaseCallPeersCount,handleIncreaseCallPeersCount),yield takeLatest(decreaseCallPeersCount,handleDecreaseCallPeersCount),yield takeLatest(callJoinDMIncoming,handleDmCallNotifyJoin),yield takeLatest(callDeclineDMIncoming,handleDmCallNotifyDecline),yield takeLatest(callNotificationReceived,handleCallNotificationReceived);}