Skip to content

Commit f3e1795

Browse files
author
Isaac
committed
Temp
1 parent 4235d7e commit f3e1795

4 files changed

Lines changed: 34 additions & 7 deletions

File tree

‎Telegram/Tests/Sources/UITests.swift‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class UITests: XCTestCase {
3131
}
3232

3333
func testSignUp() throws {
34-
deleteTestAccount(phone: "9996629999")
34+
deleteTestAccount(phone: "9996625296")
3535
app.launch()
3636

3737
// Welcome screen — tap Start Messaging

‎build-system/Make/DeployBuild.py‎

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import json
77
import hashlib
88
import base64
9+
import time
910
import requests
1011

1112
def sha256_file(path):
@@ -29,13 +30,36 @@ def init_build(host, token, files, channel):
2930
def upload_file(path, upload_info):
3031
url = upload_info.get('url')
3132
headers = dict(upload_info.get('headers', {}))
32-
33+
3334
size = os.path.getsize(path)
3435
headers['Content-Length'] = str(size)
3536

36-
print('Uploading', path)
37-
with open(path, 'rb') as f:
38-
r = requests.put(url, data=f, headers=headers, timeout=900)
37+
print('Uploading {} ({:.1f} MB)'.format(path, size / 1024 / 1024))
38+
start_time = time.time()
39+
40+
def reader():
41+
sent = 0
42+
last_print = time.time()
43+
with open(path, 'rb') as f:
44+
while True:
45+
chunk = f.read(256 * 1024)
46+
if not chunk:
47+
break
48+
sent += len(chunk)
49+
now = time.time()
50+
if now - last_print >= 5:
51+
elapsed = now - start_time
52+
speed = sent / elapsed / 1024 / 1024 if elapsed > 0 else 0
53+
print(' {:.1f}% ({:.1f} / {:.1f} MB) {:.2f} MB/s'.format(
54+
sent * 100 / size, sent / 1024 / 1024, size / 1024 / 1024, speed))
55+
last_print = now
56+
yield chunk
57+
elapsed = time.time() - start_time
58+
speed = size / elapsed / 1024 / 1024 if elapsed > 0 else 0
59+
print(' 100% - all bytes sent in {:.1f}s ({:.2f} MB/s), waiting for server response...'.format(elapsed, speed))
60+
61+
r = requests.put(url, data=reader(), headers=headers, timeout=900)
62+
print(' Server responded: {} ({:.1f}s total)'.format(r.status_code, time.time() - start_time))
3963
if r.status_code != 200:
4064
print('Upload failed', r.status_code)
4165
print(r.text[:500])

‎submodules/ChatListUI/Sources/Node/ChatListItem.swift‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2722,7 +2722,8 @@ public class ChatListItemNode: ItemListRevealOptionsItemNode {
27222722

27232723
let messageString: NSAttributedString
27242724
if !messageText.isEmpty && entities.count > 0 {
2725-
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()))
2725+
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())
2726+
messageString = foldLineBreaks(appliedString)
27262727
} else if spoilers != nil || customEmojiRanges != nil {
27272728
let mutableString = NSMutableAttributedString(string: messageText, font: textFont, textColor: theme.messageTextColor)
27282729
if let spoilers = spoilers {

‎submodules/ChatListUI/Sources/Node/ChatListItemStrings.swift‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,9 @@ public func chatListItemStrings(strings: PresentationStrings, nameDisplayOrder:
287287
}
288288
if !processed {
289289
if !message.text.isEmpty {
290-
messageText = "📎 \(messageText)"
290+
if enableMediaEmoji {
291+
messageText = "📎 \(messageText)"
292+
}
291293
} else {
292294
if fileMedia.isAnimatedSticker {
293295
messageText = strings.Message_Sticker

0 commit comments

Comments
 (0)