mirror of
https://github.com/danog/telegram-tt.git
synced 2024-12-12 09:09:45 +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 i=a(14050),n=a(33555),s=a(11192),o=a(83158),d=a(32340),r=a(59107),c=a(13103),l=a(231);const h=(0,i.X$)((0,n.c$)(((t,e)=>{let{userId:a}=e;const i=(0,s.jr)(t),n=a&&(0,s.dy)(t,a);return{chat:i,contactName:n?(0,o.Vl)(n):void 0}}))((t=>{let{isOpen:e,chat:a,userId:s,contactName:o,onClose:h}=t;const{deleteChatMember:u}=(0,n.Sv)(),p=(0,r.Z)(),f=(0,i.I4)((()=>{u({chatId:a.id,userId:s}),h()}),[a,u,h,s]);if(a&&s)return i.ZP.createElement(c.Z,{isOpen:e,onClose:h,onEnter:f,className:"delete",title:p("GroupRemoved.Remove")},i.ZP.createElement("p",null,(0,d.Z)(p("PeerInfo.Confirm.RemovePeer",o))),i.ZP.createElement(l.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:f},p("lng_box_remove")),i.ZP.createElement(l.Z,{className:"confirm-dialog-button",isText:!0,onClick:h},p("Cancel")))})))},27225:(t,e,a)=>{a.d(e,{Co:()=>M,bZ:()=>R,ft:()=>b});var i=a(33555),n=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=(0,h.P2)((t=>t()),3e3,!0),w=(0,h.Ds)((t=>t()),500,!1,!0);async function y(t,e,a){var s;let h=arguments.length>3&&void 0!==arguments[3]&&arguments[3],u=(0,i.Rd)();const p=await(0,d.t9)("fetchChats",{limit:o.Ov,offsetDate:a,archived:"archived"===t,withPinned:h,serverTimeOffset:u.serverTimeOffset,lastLocalServiceMessage:null===(s=(0,c.VF)(u))||void 0===s?void 0:s.message});if(!p)return;const{chatIds:f}=p;if(f.length>0&&f[0]===e&&f.shift(),u=(0,i.Rd)(),h&&"active"===t){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(p.users),"id")),u=(0,r.ps)(u,p.userStatusesById),u=(0,r.SL)(u,(0,l.ee)(a.concat(p.chats),"id")),u=(0,r.Mg)(u,t,f)}else h&&"archived"===t?(u=(0,r.Sh)(u,(0,l.ee)(p.users,"id")),u=(0,r.zn)(u,p.userStatusesById),u=(0,r.GL)(u,(0,l.ee)(p.chats,"id")),u=(0,r.Mg)(u,t,f)):(u=(0,r.Sh)(u,(0,l.ee)(p.users,"id")),u=(0,r.zn)(u,p.userStatusesById),u=(0,r.GL)(u,(0,l.ee)(p.chats,"id")),u=(0,r.B1)(u,t,f));u=(0,r.vv)(u,t,p),Object.keys(p.draftsById).forEach((t=>{u=(0,r.pf)(u,t,n._f,"draft",p.draftsById[t])})),Object.keys(p.replyingToById).forEach((t=>{u=(0,r.pf)(u,t,n._f,"replyingToId",p.replyingToById[t])})),0!==f.length||u.chats.isFullyLoaded[t]||(u={...u,chats:{...u.chats,isFullyLoaded:{...u.chats.isFullyLoaded,[t]:!0}}}),(0,i.R3)(u)}async function b(t){const e=await(0,d.t9)("fetchFullChat",t);if(!e)return;const{users:a,userStatusesById:n,fullInfo:s,groupCall:o,membersCount:c}=e;let h=(0,i.Rd)();if(a&&(h=(0,r.Sh)(h,(0,l.ee)(a,"id"))),n&&(h=(0,r.zn)(h,n)),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,i.R3)(h);const u=s.stickerSet;return u&&(0,i.Sv)().loadStickers({stickerSetId:u.id,stickerSetAccessHash:u.accessHash,stickerSetShortName:u.shortName}),e}async function R(t){try{return await(0,d.t9)("migrateChat",t)}catch(t){return void("CHANNELS_TOO_MUCH"===t.message?(0,i.Sv)().openLimitReachedModal({limit:"channels"}):(0,i.Sv)().showDialog({data:{...t,hasErrorKey:!0}}))}}async function M(t){const e=(0,i.Rd)(),a=(0,c.DI)(e,t);if(a&&!a.isMin)return a;const n=await(0,d.t9)("getChatByUsername",t);return n?((0,i.R3)((0,r.a4)((0,i.Rd)(),n.id,n)),n):void 0}async function S(t,e,a,n){const s=await M(a);if(!s)return;const o=(0,c.dy)((0,i.Rd)(),s.id);o&&o.isAttachMenuBot?t.callAttachMenuBot({botId:o.id,chatId:e,..."string"==typeof n&&{startParam:n}}):t.showNotification({message:I.i0("WebApp.AddToAttachmentUnavailableError")})}(0,i.iw)("preloadTopChatMessages",(async(t,e)=>{const a=new Set;for(let i=0;i<o.Mo;i++){await(0,h.wO)(100);const{chatId:i}=(0,c.Bt)(t)||{},s=(0,m.gO)(o.Nf),d=null==s?void 0:s.find((t=>t!==i&&!a.has(t)));if(!d)return;a.add(d),e.loadViewportMessages({chatId:d,threadId:n._f})}})),(0,i.iw)("openChat",((t,e,a)=>{var i;const{id:s,threadId:o=n._
|
||
|
//# sourceMappingURL=9970.9e76fbb3596b6579deb3.js.map
|