telegram-tt/dist/9954.836adcc6b64f2d9ed43a.js

3 lines
62 KiB
JavaScript
Raw Permalink Normal View History

2022-09-24 01:42:13 +02:00
/*! For license information please see 9954.836adcc6b64f2d9ed43a.js.LICENSE.txt */
2022-09-14 13:58:43 +02:00
(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[9954],{47903:(e,t,a)=>{"use strict";a.r(t),a.d(t,{ActiveCallHeader:()=>X,GroupCall:()=>z,PhoneCall:()=>ae,RatePhoneCallModal:()=>ie});var n=a(73794),i=a(14050),o=a(33555),s=a(83716),r=a(71226),l=a(11192),c=a(42431),d=a(78958),u=a(88422),p=a(27225);(0,o.iw)("leaveGroupCall",(async(e,t,a)=>{const{isFromLibrary:i,shouldDiscard:s,shouldRemove:l,rejoin:p}=a||{},m=(0,c.mU)(e);m&&((0,o.R3)((0,d.Ic)(e,{connectionState:"disconnected"},m.participantsCount-1)),await(0,r.t9)("leaveGroupCall",{call:m}),s&&await(0,r.t9)("discardGroupCall",{call:m}),e=(0,o.Rd)(),l&&(e=(0,d.dc)(e,m.id)),(0,u.Mt)(),(0,o.R3)({...e,groupCalls:{...e.groupCalls,activeGroupCallId:void 0},isCallPanelVisible:void 0}),i||(0,n.leaveGroupCall)(),p&&t.joinGroupCall(p))})),(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,r.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,r.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/s.Ro)/100),(0,r.t9)("editGroupCallParticipant",{call:d,volume:Number(o),participant:u}))})),(0,o.iw)("toggleGroupCallMute",(async(e,t,a)=>{const{participantId:i,value:o}=a||{},s=(0,c.mU)(e),d=(0,l.dy)(e,i||e.currentUserId);if(!d||!s)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,r.t9)("editGroupCallParticipant",{call:s,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,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.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,u.FF)(),s=(0,u.NH)();if(!i||!s)return;const{currentUserId:d}=e;if(!d)return;const m=await(0,n.joinGroupCall)(d,s,i,t.apiUpdate);if(await(0,r.t9)("joinGroupCall",{call:a,params:m,inviteHash:a.inviteHash})&&(t.loadMoreGroupCallParticipants(),a.chatId)){const e=(0,l.Z1)((0,o.Rd)(),a.chatId);if(!e)return;await(0,p.ft)(e)}})),(0,o.iw)("connectToActivePhoneCall",(async(e,t)=>{const{phoneCall:a}=e;if(!a)return;const n=(0,c.fu)(e);if(!n)return;const i=await(0,r.t9)("getDhConfig");if(!i)return;await(0,r.t9)("createPhoneCallState",[!0]);const o=await(0,r.t9)("requestPhoneCall",[i]);await(0,r.t9)("requestCall",{user:n,gAHash:o,isVideo:a.isVideo})||t.hangUp()})),(0,o.iw)("acceptCall",(async e=>{const{phoneCall:t}=e;if(!t)return;const a=await(0,r.t9)("getDhConfig");if(!a)return;await(0,r.t9)("createPhoneCallState",[!1]);const n=await(0,r.t9)("acceptPhoneCall",[a]);(0,r.t9)("acceptCall",{call:t,gB:n})})),(0,o.iw)("sendSignalingData",((e,t,a)=>{const{phoneCall:n}=e;if(!n)return;const i=JSON.stringify(a);(async()=>{const e=await(0,r.t9)("encodePhoneCallData",[i]);e&&(0,r.t9)("sendSignalingData",{data:e,call:n})})()})),(0,o.iw)("closeCallRatingModal",(e=>({...e,ratingPhoneCall:void 0}))),(0,o.iw)("setCallRating",((e,t,a)=>{const{ratingPhoneCall:n}=e;if(!n)return;const{rating:i,comment:o}=a;return(0,r.t9)("setCallRating",{call:n,rating:i,comment:o}),{...e,ratingPhoneCall:void 0}})),(0,o.iw)("hangUp",(e=>{const{phoneCall:t}=e;if(t){if("discarded"===t.state)return(0,r.t9)("destroyPhoneCallState"),(0
2022-09-24 01:42:13 +02:00
//# sourceMappingURL=9954.836adcc6b64f2d9ed43a.js.map