mirror of
https://github.com/danog/telegram-tt.git
synced 2024-12-15 02:37:17 +01:00
2 lines
28 KiB
JavaScript
2 lines
28 KiB
JavaScript
|
"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[9970],{22275:(t,e,a)=>{a.d(e,{Z:()=>h});var n=a(14050),i=a(33555),s=a(11192),o=a(83158),d=a(32340),r=a(59107),c=a(13103),l=a(231);const h=(0,n.X$)((0,i.c$)(((t,e)=>{let{userId:a}=e;const n=(0,s.jr)(t),i=a&&(0,s.dy)(t,a);return{chat:n,contactName:i?(0,o.Vl)(i):void 0}}))((t=>{let{isOpen:e,chat:a,userId:s,contactName:o,onClose:h}=t;const{deleteChatMember:u}=(0,i.Sv)(),p=(0,r.Z)(),f=(0,n.I4)((()=>{u({chatId:a.id,userId:s}),h()}),[a,u,h,s]);if(a&&s)return n.ZP.createElement(c.Z,{isOpen:e,onClose:h,onEnter:f,className:"delete",title:p("GroupRemoved.Remove")},n.ZP.createElement("p",null,(0,d.Z)(p("PeerInfo.Confirm.RemovePeer",o))),n.ZP.createElement(l.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:f},p("lng_box_remove")),n.ZP.createElement(l.Z,{className:"confirm-dialog-button",isText:!0,onClick:h},p("Cancel")))})))},27225:(t,e,a)=>{a.d(e,{Co:()=>S,bZ:()=>M,ft:()=>R});var n=a(33555),i=a(6137),s=a(91713),o=a(83716),d=a(71226),r=a(5161),c=a(11192),l=a(60782),h=a(69118),u=a(83158),p=a(53551),f=a(78958),C=a(42431),m=a(16974),I=a(50711),g=a(9211);const v={id:o.aw,accessHash:"0",type:"userTypeRegular",isMin:!0,username:"",phoneNumber:""},w=(0,h.P2)((t=>t()),3e3,!0),y=(0,h.Ds)((t=>t()),500,!1,!0);async function b(t,e,a){var s;let h=arguments.length>3&&void 0!==arguments[3]&&arguments[3],u=(0,n.Rd)();const p=null===(s=(0,c.VF)(u))||void 0===s?void 0:s.message,f=await(0,d.t9)("fetchChats",{limit:o.Ov,offsetDate:a,archived:"archived"===t,withPinned:h,serverTimeOffset:u.serverTimeOffset,lastLocalServiceMessage:p});if(!f)return;const{chatIds:C}=f;if(C.length>0&&C[0]===e&&C.shift(),u=(0,n.Rd)(),h&&"active"===t){if(!C.includes(o.aw)){const t=await(0,d.t9)("fetchChat",{type:"user",user:v});u=(0,n.Rd)();const e=t&&(0,c.Z1)(u,t.chatId);e&&(C.unshift(e.id),f.chats.unshift(e),p&&(e.lastMessage=p))}const e=(0,c.jr)(u),a=e?[e]:[],i=(0,c.P2)(u)||[];u.currentUserId&&u.users.byId[u.currentUserId]&&i.push(u.users.byId[u.currentUserId]),u=(0,r.s5)(u,(0,l.ee)(i.concat(f.users),"id")),u=(0,r.ps)(u,f.userStatusesById),u=(0,r.SL)(u,(0,l.ee)(a.concat(f.chats),"id")),u=(0,r.Mg)(u,t,C)}else h&&"archived"===t?(u=(0,r.Sh)(u,(0,l.ee)(f.users,"id")),u=(0,r.zn)(u,f.userStatusesById),u=(0,r.GL)(u,(0,l.ee)(f.chats,"id")),u=(0,r.Mg)(u,t,C)):(u=(0,r.Sh)(u,(0,l.ee)(f.users,"id")),u=(0,r.zn)(u,f.userStatusesById),u=(0,r.GL)(u,(0,l.ee)(f.chats,"id")),u=(0,r.B1)(u,t,C));u=(0,r.vv)(u,t,f),Object.keys(f.draftsById).forEach((t=>{u=(0,r.pf)(u,t,i._f,"draft",f.draftsById[t])})),Object.keys(f.replyingToById).forEach((t=>{u=(0,r.pf)(u,t,i._f,"replyingToId",f.replyingToById[t])})),0!==C.length||u.chats.isFullyLoaded[t]||(u={...u,chats:{...u.chats,isFullyLoaded:{...u.chats.isFullyLoaded,[t]:!0}}}),(0,n.R3)(u)}async function R(t){const e=await(0,d.t9)("fetchFullChat",t);if(!e)return;const{users:a,userStatusesById:i,fullInfo:s,groupCall:o,membersCount:c}=e;let h=(0,n.Rd)();if(a&&(h=(0,r.Sh)(h,(0,l.ee)(a,"id"))),i&&(h=(0,r.zn)(h,i)),o){const t=(0,C.$5)(h,o.id);h=(0,f.AH)(h,o.id,(0,l.CE)(o,["connectionState"]),void 0,t?void 0:o.participantsCount)}h=(0,r.a4)(h,t.id,{fullInfo:s,...c&&{membersCount:c}}),(0,n.R3)(h);const u=s.stickerSet;return u&&(0,n.Sv)().loadStickers({stickerSetId:u.id,stickerSetAccessHash:u.accessHash,stickerSetShortName:u.shortName}),e}async function M(t){try{return await(0,d.t9)("migrateChat",t)}catch(t){return void("CHANNELS_TOO_MUCH"===t.message?(0,n.Sv)().openLimitReachedModal({limit:"channels"}):(0,n.Sv)().showDialog({data:{...t,hasErrorKey:!0}}))}}async function S(t){const e=(0,n.Rd)(),a=(0,c.DI)(e,t);if(a&&!a.isMin)return a;const i=await(0,d.t9)("getChatByUsername",t);return i?((0,n.R3)((0,r.a4)((0,n.Rd)(),i.id,i)),i):void 0}async function P(t,e,a,i){const s=await S(a);if(!s)return;const o=(0,c.dy)((0,n.Rd)(),s.id);o&&o.isAttachMenuBot?t.callAttachMenuBot({botId:o.id,chatId:e,..."string"==typeof i&&{startParam:i}}):t.showNotification({message:I.i0("WebApp.AddToAttachmentUnavailableError")})}(0,n.iw)("preloadTopChatMessages",(async(t,e)=>{const a=new Set;fo
|
||
|
//# sourceMappingURL=9970.3bee91fb23bf1762eee4.js.map
|