mirror of
https://github.com/danog/telegram-tt.git
synced 2025-01-10 14:58:32 +01:00
3 lines
38 KiB
JavaScript
3 lines
38 KiB
JavaScript
|
/*! For license information please see 757.e669f135f9dce66de020.js.LICENSE.txt */
|
||
|
(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[757],{3535:(e,t,a)=>{"use strict";a.r(t),a.d(t,{ActiveCallHeader:()=>z,GroupCall:()=>B});var n=a(3794),i=a(4050),o=a(5116),r=a(1226),s=a(1638),l=a(2607),c=a(4446),d=a(3716),u=a(782),p=a(1689),m=a(6204);(0,o.Q6)("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,l.GU)(e,i,a.userId))break;return(0,c.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,c.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,l.mU)(e);null!=i&&i.participants&&Object.keys(i.participants).length>0&&(0,n.handleUpdateGroupCallParticipants)(Object.values(i.participants));break}}})),(0,o.Q6)("leaveGroupCall",((e,t,a)=>{const{isFromLibrary:i,shouldDiscard:s,shouldRemove:d,rejoin:u}=a||{},m=(0,l.mU)(e);m&&(e=(0,c.Ic)(e,{connectionState:"disconnected"},m.participantsCount-1),(async()=>{await(0,r.t9)("leaveGroupCall",{call:m}),s&&await(0,r.t9)("discardGroupCall",{call:m}),e=(0,o.Rd)(),d&&(e=(0,c.dc)(e,m.id)),(0,p.Mt)(),(0,o.R3)({...e,groupCalls:{...e.groupCalls,isGroupCallPanelHidden:!0,activeGroupCallId:void 0}}),i||(0,n.leaveGroupCall)(),u&&t.joinGroupCall(u)})())})),(0,o.Q6)("toggleGroupCallVideo",(e=>{const t=(0,l.mU)(e),a=(0,s.dy)(e,e.currentUserId);a&&t&&(async()=>{await(0,n.toggleStream)("video"),await(0,r.t9)("editGroupCallParticipant",{call:t,videoStopped:!(0,n.isStreamEnabled)("video"),participant:a})})()})),(0,o.Q6)("requestToSpeak",((e,t,a)=>{const{value:n}=a||{value:!0},i=(0,l.mU)(e),o=(0,s.dy)(e,e.currentUserId);o&&i&&(0,r.t9)("editGroupCallParticipant",{call:i,raiseHand:n,participant:o})})),(0,o.Q6)("setGroupCallParticipantVolume",((e,t,a)=>{const{participantId:i,volume:o}=a,c=(0,l.mU)(e),u=(0,s.dy)(e,i);u&&c&&((0,n.setVolume)(i,Math.floor(o/d.Ro)/100),(0,r.t9)("editGroupCallParticipant",{call:c,volume:Number(o),participant:u}))})),(0,o.Q6)("toggleGroupCallMute",((e,t,a)=>{const{participantId:i,value:o}=a||{},c=(0,l.mU)(e),d=(0,s.dy)(e,i||e.currentUserId);d&&c&&(async()=>{const e=void 0===o?(0,n.isStreamEnabled)("audio",d.id):o;i?(0,n.setVolume)(i,e?0:1):await(0,n.toggleStream)("audio"),await(0,r.t9)("editGroupCallParticipant",{call:c,muted:e,participant:d})})()})),(0,o.Q6)("toggleGroupCallPresentation",((e,t,a)=>{const i=(0,l.mU)(e),o=(0,s.dy)(e,e.currentUserId);o&&i&&(async()=>{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,r.t9)("joinGroupCallPresentation",{call:i,params:e})}else await(0,n.toggleStream)("presentation",!1),await(0,r.t9)("leaveGroupCallPresentation",{call:i});await(0,r.t9)("editGroupCallParticipant",{call:i,presentationPaused:!(0,n.isStreamEnabled)("presentation"),participant:o})})()})),(0,o.Q6)("connectToActiveGroupCall",((e,t)=>{const a=(0,l.mU)(e);if(!a)return;if("discarded"===a.connectionState)return void t.showNotification({message:"This voice chat is not active"});const i=(0,p.FF)(),c=(0,p.NH)();if(!i||!c)return;const{currentUserId:d}=e;d&&(async()=>{const e=await(0,n.joinGroupCall)(d,c,i,t.apiUpdate);if(await(0,r.t9)("joinGroupCall",{call:a,params:e,inviteHash:a.inviteHash})&&(t.loadMoreGroupCallParticipants(),a.chatId)){const e=(0,s.Z1)((0,o.Rd)(),a.chatId);if(!e)return;await(0,m.f)(e)}})()}));var v=a(7361),g=a(6752),f=a(706),C=a(9107),S=a(4288),P=a(231),h=a(3106),E=a(8964),b=a(3103);const y=()=>{var e,t;null===(e=(t=navigator).vibrate)||void 0===e||e.cal
|
||
|
//# sourceMappingURL=757.e669f135f9dce66de020.js.map
|