From f3e1795b680f6bbd1b56e76a285722fe552f32a5 Mon Sep 17 00:00:00 2001 From: Isaac <> Date: Tue, 7 Apr 2026 08:11:27 +0200 Subject: [PATCH] Temp --- Telegram/Tests/Sources/UITests.swift | 2 +- build-system/Make/DeployBuild.py | 32 ++++++++++++++++--- .../Sources/Node/ChatListItem.swift | 3 +- .../Sources/Node/ChatListItemStrings.swift | 4 ++- 4 files changed, 34 insertions(+), 7 deletions(-) diff --git a/Telegram/Tests/Sources/UITests.swift b/Telegram/Tests/Sources/UITests.swift index 722c782f14..6df5294fe7 100644 --- a/Telegram/Tests/Sources/UITests.swift +++ b/Telegram/Tests/Sources/UITests.swift @@ -31,7 +31,7 @@ class UITests: XCTestCase { } func testSignUp() throws { - deleteTestAccount(phone: "9996629999") + deleteTestAccount(phone: "9996625296") app.launch() // Welcome screen — tap Start Messaging diff --git a/build-system/Make/DeployBuild.py b/build-system/Make/DeployBuild.py index 33b0ae4fdc..db7f0a8bce 100644 --- a/build-system/Make/DeployBuild.py +++ b/build-system/Make/DeployBuild.py @@ -6,6 +6,7 @@ import sys import json import hashlib import base64 +import time import requests def sha256_file(path): @@ -29,13 +30,36 @@ def init_build(host, token, files, channel): def upload_file(path, upload_info): url = upload_info.get('url') headers = dict(upload_info.get('headers', {})) - + size = os.path.getsize(path) headers['Content-Length'] = str(size) - print('Uploading', path) - with open(path, 'rb') as f: - r = requests.put(url, data=f, headers=headers, timeout=900) + print('Uploading {} ({:.1f} MB)'.format(path, size / 1024 / 1024)) + start_time = time.time() + + def reader(): + sent = 0 + last_print = time.time() + with open(path, 'rb') as f: + while True: + chunk = f.read(256 * 1024) + if not chunk: + break + sent += len(chunk) + now = time.time() + if now - last_print >= 5: + elapsed = now - start_time + speed = sent / elapsed / 1024 / 1024 if elapsed > 0 else 0 + print(' {:.1f}% ({:.1f} / {:.1f} MB) {:.2f} MB/s'.format( + sent * 100 / size, sent / 1024 / 1024, size / 1024 / 1024, speed)) + last_print = now + yield chunk + elapsed = time.time() - start_time + speed = size / elapsed / 1024 / 1024 if elapsed > 0 else 0 + print(' 100% - all bytes sent in {:.1f}s ({:.2f} MB/s), waiting for server response...'.format(elapsed, speed)) + + r = requests.put(url, data=reader(), headers=headers, timeout=900) + print(' Server responded: {} ({:.1f}s total)'.format(r.status_code, time.time() - start_time)) if r.status_code != 200: print('Upload failed', r.status_code) print(r.text[:500]) diff --git a/submodules/ChatListUI/Sources/Node/ChatListItem.swift b/submodules/ChatListUI/Sources/Node/ChatListItem.swift index 76692de347..af1a1be48c 100644 --- a/submodules/ChatListUI/Sources/Node/ChatListItem.swift +++ b/submodules/ChatListUI/Sources/Node/ChatListItem.swift @@ -2722,7 +2722,8 @@ public class ChatListItemNode: ItemListRevealOptionsItemNode { let messageString: NSAttributedString if !messageText.isEmpty && entities.count > 0 { - messageString = foldLineBreaks(stringWithAppliedEntities(messageText, entities: entities, strings: item.presentationData.strings, dateTimeFormat: item.presentationData.dateTimeFormat, baseColor: theme.messageTextColor, linkColor: theme.messageTextColor, baseFont: textFont, linkFont: textFont, boldFont: textFont, italicFont: italicTextFont, boldItalicFont: textFont, fixedFont: textFont, blockQuoteFont: textFont, underlineLinks: false, message: message._asMessage())) + let appliedString = stringWithAppliedEntities(messageText, entities: entities, strings: item.presentationData.strings, dateTimeFormat: item.presentationData.dateTimeFormat, baseColor: theme.messageTextColor, linkColor: theme.messageTextColor, baseFont: textFont, linkFont: textFont, boldFont: textFont, italicFont: italicTextFont, boldItalicFont: textFont, fixedFont: textFont, blockQuoteFont: textFont, underlineLinks: false, message: message._asMessage()) + messageString = foldLineBreaks(appliedString) } else if spoilers != nil || customEmojiRanges != nil { let mutableString = NSMutableAttributedString(string: messageText, font: textFont, textColor: theme.messageTextColor) if let spoilers = spoilers { diff --git a/submodules/ChatListUI/Sources/Node/ChatListItemStrings.swift b/submodules/ChatListUI/Sources/Node/ChatListItemStrings.swift index e82cfbb84d..824887b5d4 100644 --- a/submodules/ChatListUI/Sources/Node/ChatListItemStrings.swift +++ b/submodules/ChatListUI/Sources/Node/ChatListItemStrings.swift @@ -287,7 +287,9 @@ public func chatListItemStrings(strings: PresentationStrings, nameDisplayOrder: } if !processed { if !message.text.isEmpty { - messageText = "📎 \(messageText)" + if enableMediaEmoji { + messageText = "📎 \(messageText)" + } } else { if fileMedia.isAnimatedSticker { messageText = strings.Message_Sticker