telegram-tt/dist/654.5a866391dbb2ac6c1621.js

3 lines
39 KiB
JavaScript
Raw Normal View History

2022-04-01 21:03:25 +02:00
/*! For license information please see 654.5a866391dbb2ac6c1621.js.LICENSE.txt */
(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[654],{7526:(e,t,a)=>{"use strict";a.r(t),a.d(t,{ActiveCallHeader:()=>X,CallFallbackConfirm:()=>K,GroupCall:()=>J});var n=a(3794),i=a(4050),o=a(3555),r=a(3716),s=a(1226),l=a(1192),c=a(2431),d=a(8958),u=a(782),p=a(2267),m=a(1394),v=a(8422),g=a(7225),f=a(1171);(0,o.iw)("apiUpdate",((e,t,a)=>{const{activeGroupCallId:i}=e.groupCalls;switch(a["@type"]){case"updateGroupCallLeavePresentation":t.toggleGroupCallPresentation({value:!1});break;case"updateGroupCallStreams":if(!a.userId||!i)break;if(!(0,c.GU)(e,i,a.userId))break;return(0,d.B6)(e,i,a.userId,(0,u.CE)(a,["@type","userId"]));case"updateGroupCallConnectionState":if(!i)break;if("disconnected"===a.connectionState){t.leaveGroupCall({isFromLibrary:!0});break}return(0,d.AH)(e,i,{connectionState:a.connectionState,isSpeakerDisabled:a.isSpeakerDisabled});case"updateGroupCallParticipants":{const{groupCallId:e,participants:t}=a;i===e&&(0,n.handleUpdateGroupCallParticipants)(t);break}case"updateGroupCallConnection":{if(a.data.stream){t.showNotification({message:"Big live streams are not yet supported"}),t.leaveGroupCall();break}(0,n.handleUpdateGroupCallConnection)(a.data,a.presentation);const i=(0,c.mU)(e);null!=i&&i.participants&&Object.keys(i.participants).length>0&&(0,n.handleUpdateGroupCallParticipants)(Object.values(i.participants));break}}})),(0,o.iw)("leaveGroupCall",(async(e,t,a)=>{const{isFromLibrary:i,shouldDiscard:r,shouldRemove:l,rejoin:u}=a||{},p=(0,c.mU)(e);if(!p)return;(0,o.R3)((0,d.Ic)(e,{connectionState:"disconnected"},p.participantsCount-1)),await(0,s.t9)("leaveGroupCall",{call:p});let m=!1;var g;r&&((e=(0,o.Rd)()).groupCalls.fallbackChatId===p.chatId&&(m=!0,null===(g=e.groupCalls.fallbackUserIdsToRemove)||void 0===g||g.forEach((a=>{t.deleteChatMember({chatId:e.groupCalls.fallbackChatId,userId:a})}))),await(0,s.t9)("discardGroupCall",{call:p}));e=(0,o.Rd)(),l&&(e=(0,d.dc)(e,p.id)),(0,v.Mt)(),(0,o.R3)({...e,groupCalls:{...e.groupCalls,isGroupCallPanelHidden:!0,activeGroupCallId:void 0,...m&&{fallbackChatId:void 0,fallbackUserIdsToRemove:void 0}}}),i||(0,n.leaveGroupCall)(),u&&t.joinGroupCall(u)})),(0,o.iw)("toggleGroupCallVideo",(async e=>{const t=(0,c.mU)(e),a=(0,l.dy)(e,e.currentUserId);a&&t&&(await(0,n.toggleStream)("video"),await(0,s.t9)("editGroupCallParticipant",{call:t,videoStopped:!(0,n.isStreamEnabled)("video"),participant:a}))})),(0,o.iw)("requestToSpeak",((e,t,a)=>{const{value:n}=a||{value:!0},i=(0,c.mU)(e),o=(0,l.dy)(e,e.currentUserId);o&&i&&(0,s.t9)("editGroupCallParticipant",{call:i,raiseHand:n,participant:o})})),(0,o.iw)("setGroupCallParticipantVolume",((e,t,a)=>{const{participantId:i,volume:o}=a,d=(0,c.mU)(e),u=(0,l.dy)(e,i);u&&d&&((0,n.setVolume)(i,Math.floor(o/r.Ro)/100),(0,s.t9)("editGroupCallParticipant",{call:d,volume:Number(o),participant:u}))})),(0,o.iw)("toggleGroupCallMute",(async(e,t,a)=>{const{participantId:i,value:o}=a||{},r=(0,c.mU)(e),d=(0,l.dy)(e,i||e.currentUserId);if(!d||!r)return;const u=void 0===o?(0,n.isStreamEnabled)("audio",d.id):o;i?(0,n.setVolume)(i,u?0:1):await(0,n.toggleStream)("audio"),await(0,s.t9)("editGroupCallParticipant",{call:r,muted:u,participant:d})})),(0,o.iw)("toggleGroupCallPresentation",(async(e,t,a)=>{const i=(0,c.mU)(e),o=(0,l.dy)(e,e.currentUserId);if(o&&i){if(void 0!==(null==a?void 0:a.value)?null==a?void 0:a.value:!(0,n.isStreamEnabled)("presentation")){const e=await(0,n.startSharingScreen)();if(!e)return;await(0,s.t9)("joinGroupCallPresentation",{call:i,params:e})}else await(0,n.toggleStream)("presentation",!1),await(0,s.t9)("leaveGroupCallPresentation",{call:i});await(0,s.t9)("editGroupCallParticipant",{call:i,presentationPaused:!(0,n.isStreamEnabled)("presentation"),participant:o})}})),(0,o.iw)("connectToActiveGroupCall",(async(e,t)=>{const a=(0,c.mU)(e);if(!a)return;if("discarded"===a.connectionState)return void t.showNotification({message:"This voice chat is not active"});const i=(0,v.FF)(),r=(0,v.NH)();if(!i||!r)return;const{currentUserId:d}=e;if(!d)return;const u=await(0,n.joinGroupCall)(d,r,i,t.apiUpdate);if(await(0,s.t9)("joinGro
//# sourceMappingURL=654.5a866391dbb2ac6c1621.js.map