telegram-tt/dist/302.fde2dcaf1124227a1d9e.js

2 lines
24 KiB
JavaScript
Raw Normal View History

2022-02-13 22:54:56 +01:00
"use strict";(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[302],{2275:(t,e,a)=>{a.d(e,{Z:()=>h});var s=a(4050),n=a(5116),o=a(9066),i=a(8415),d=a(2340),r=a(9107),c=a(3103),l=a(231);const h=(0,s.X$)((0,n.c$)(((t,e)=>{let{userId:a}=e;const s=(0,o.jr)(t),n=a&&(0,o.dy)(t,a);return{chat:s,contactName:n?(0,i.Vl)(n):void 0}}))((t=>{let{isOpen:e,chat:a,userId:o,contactName:i,onClose:h}=t;const{deleteChatMember:u}=(0,n.uC)(),p=(0,r.Z)(),f=(0,s.I4)((()=>{u({chatId:a.id,userId:o}),h()}),[a,u,h,o]);if(a&&o)return s.ZP.createElement(c.Z,{isOpen:e,onClose:h,onEnter:f,className:"delete",title:p("GroupRemoved.Remove")},s.ZP.createElement("p",null,(0,d.Z)(p("PeerInfo.Confirm.RemovePeer",i))),s.ZP.createElement(l.Z,{color:"danger",className:"confirm-dialog-button",isText:!0,onClick:f},p("lng_box_remove")),s.ZP.createElement(l.Z,{className:"confirm-dialog-button",isText:!0,onClick:h},p("Cancel")))})))},6204:(t,e,a)=>{a.d(e,{f:()=>y,C:()=>b});var s=a(5116),n=a(6137),o=a(1713),i=a(3716),d=a(1226),r=a(9959),c=a(9066),l=a(782),h=a(9118),u=a(8415),p=a(3551),f=a(4446),C=a(2607),I=a(6974);const m=(0,h.P2)((t=>t()),3e3,!0),g=(0,h.Ds)((t=>t()),500,!1,!0);async function v(t,e,a){var o;let h=arguments.length>3&&void 0!==arguments[3]&&arguments[3],u=(0,s.Rd)();const p=await(0,d.t9)("fetchChats",{limit:i.Ov,offsetDate:a,archived:"archived"===t,withPinned:h,serverTimeOffset:u.serverTimeOffset,lastLocalServiceMessage:null===(o=(0,c.VF)(u))||void 0===o?void 0:o.message});if(!p)return;const{chatIds:f}=p;if(f.length>0&&f[0]===e&&f.shift(),u=(0,s.Rd)(),h&&"active"===t){const e=(0,c.jr)(u),a=e?[e]:[],s=(0,c.P2)(u)||[];u.currentUserId&&u.users.byId[u.currentUserId]&&s.push(u.users.byId[u.currentUserId]),u=(0,r.s5)(u,(0,l.ee)(s.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,s.R3)(u)}async function y(t){const e=await(0,d.t9)("fetchFullChat",t);if(!e)return;const{users:a,fullInfo:n,groupCall:o}=e;let i=(0,s.Rd)();if(a&&(i=(0,r.Sh)(i,(0,l.ee)(a,"id"))),o){const t=(0,C.$5)(i,o.id);i=(0,f.AH)(i,o.id,(0,l.CE)(o,["connectionState"]),void 0,t?void 0:o.participantsCount)}return i=(0,r.a4)(i,t.id,{fullInfo:n}),(0,s.R3)(i),e}async function b(t){const e=(0,s.Rd)(),a=(0,c.DI)(e,t);if(a&&!a.isMin)return a;const n=await(0,d.t9)("getChatByUsername",t);return n?((0,s.R3)((0,r.a4)((0,s.Rd)(),n.id,n)),n):void 0}(0,s.Q6)("preloadTopChatMessages",((t,e)=>{(async()=>{const a=new Set;for(let s=0;s<i.ul;s++){await(0,h.wO)(100);const{chatId:s}=(0,c.Bt)(t)||{},o=(0,I.gO)(i.Nf),d=null==o?void 0:o.find((t=>t!==s&&!a.has(t)));if(!d)return;a.add(d),e.loadViewportMessages({chatId:d,threadId:n._f})}})()})),(0,s.Q6)("openChat",((t,e,a)=>{const{id:s,threadId:o}=a,{currentUserId:i}=t,r=(0,c.Z1)(t,s);if(null!=r&&r.hasUnreadMark&&e.toggleChatUnread({id:s}),r&&r.lastMessage&&r.lastMessage.threadInfo&&e.requestThreadInfoUpdate({chatId:r.lastMessage.threadInfo.chatId,threadId:r.lastMessage.threadInfo.threadId}),r)(0,u.Hp)(r)&&!r.isMin&&e.requestChatUpdate({chatId:s});else if(s===i)(0,d.t9)("fetchChat",{type:"self"});else{const e=(0,c.dy)(t,s);e&&(0,d.t9)("fetchChat",{type:"user",user:e})}o!==n._f&&((0,c.qS)(t,s,o)||e.requestThreadInfoUpdate({chatId:s,threadId:o}))})),(0,s.Q6)("openLinkedChat",((t,e,a)=>{const{id:s}=a,n=(0,c.Z1)(t,s);n&&(async()=>{var t;const a=await(0,d.t9)("fetchFullChat",n);null!=a&&null!==(t=a.fullInfo)&&void 0!==t&&t.linkedChatId&&e.openChat({id:a.fullInfo.linkedChatId})})()})),(0,s.Q6)("foc
2022-02-20 12:49:20 +01:00
//# sourceMappingURL=302.fde2dcaf1124227a1d9e.js.map