Skip to content

Commit e77ac04

Browse files
committed
update to 9.6.3
1 parent 3c9a4c1 commit e77ac04

14 files changed

+64
-57
lines changed

‎TMessagesProj/jni/tgnet/Defines.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
#define USE_DEBUG_SESSION false
2020
#define READ_BUFFER_SIZE 1024 * 1024 * 2
21-
//#define DEBUG_VERSION
21+
#define DEBUG_VERSION
2222
#define PFS_ENABLED 1
2323
#define DEFAULT_DATACENTER_ID INT_MAX
2424
#define DC_UPDATE_TIME 60 * 60

‎TMessagesProj/jni/tgnet/Handshake.cpp

+28-26
Original file line numberDiff line numberDiff line change
@@ -940,32 +940,33 @@ void Handshake::loadCdnConfig(Datacenter *datacenter) {
940940
if (loadingCdnKeys) {
941941
return;
942942
}
943-
if (cdnPublicKeysFingerprints.empty()) {
944-
if (cdnConfig == nullptr) {
945-
cdnConfig = new Config(datacenter->instanceNum, "cdnkeys.dat");
946-
}
947-
NativeByteBuffer *buffer = cdnConfig->readConfig();
948-
if (buffer != nullptr) {
949-
uint32_t version = buffer->readUint32(nullptr);
950-
if (version >= 1) {
951-
size_t count = buffer->readUint32(nullptr);
952-
for (uint32_t a = 0; a < count; a++) {
953-
int dcId = buffer->readInt32(nullptr);
954-
cdnPublicKeys[dcId] = buffer->readString(nullptr);
955-
cdnPublicKeysFingerprints[dcId] = buffer->readUint64(nullptr);
956-
}
957-
}
958-
buffer->reuse();
959-
if (!cdnPublicKeysFingerprints.empty()) {
960-
size_t count = cdnWaitingDatacenters.size();
961-
for (uint32_t a = 0; a < count; a++) {
962-
cdnWaitingDatacenters[a]->beginHandshake(HandshakeTypeCurrent, false);
963-
}
964-
cdnWaitingDatacenters.clear();
965-
return;
966-
}
967-
}
968-
}
943+
if (LOGS_ENABLED) DEBUG_D("account%u dc%u loadCdnConfig", datacenter->instanceNum, datacenter->datacenterId);
944+
// if (cdnPublicKeysFingerprints.empty()) {
945+
// if (cdnConfig == nullptr) {
946+
// cdnConfig = new Config(datacenter->instanceNum, "cdnkeys.dat");
947+
// }
948+
// NativeByteBuffer *buffer = cdnConfig->readConfig();
949+
// if (buffer != nullptr) {
950+
// uint32_t version = buffer->readUint32(nullptr);
951+
// if (version >= 1) {
952+
// size_t count = buffer->readUint32(nullptr);
953+
// for (uint32_t a = 0; a < count; a++) {
954+
// int dcId = buffer->readInt32(nullptr);
955+
// cdnPublicKeys[dcId] = buffer->readString(nullptr);
956+
// cdnPublicKeysFingerprints[dcId] = buffer->readUint64(nullptr);
957+
// }
958+
// }
959+
// buffer->reuse();
960+
// if (!cdnPublicKeysFingerprints.empty()) {
961+
// size_t count = cdnWaitingDatacenters.size();
962+
// for (uint32_t a = 0; a < count; a++) {
963+
// cdnWaitingDatacenters[a]->beginHandshake(HandshakeTypeCurrent, false);
964+
// }
965+
// cdnWaitingDatacenters.clear();
966+
// return;
967+
// }
968+
// }
969+
// }
969970
loadingCdnKeys = true;
970971
auto request = new TL_help_getCdnConfig();
971972

@@ -1008,6 +1009,7 @@ void Handshake::loadCdnConfig(Datacenter *datacenter) {
10081009
buffer->reuse();
10091010
BIO_free(keyBio);
10101011
count = cdnWaitingDatacenters.size();
1012+
if (LOGS_ENABLED) DEBUG_D("account%u dc%u cdnConfig loaded begin handshake", datacenter->instanceNum, datacenter->datacenterId);
10111013
for (uint32_t a = 0; a < count; a++) {
10121014
cdnWaitingDatacenters[a]->beginHandshake(HandshakeTypeCurrent, false);
10131015
}

‎TMessagesProj/src/main/java/org/telegram/messenger/BuildVars.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ public class BuildVars {
2424
public static boolean USE_CLOUD_STRINGS = true;
2525
public static boolean CHECK_UPDATES = true;
2626
public static boolean NO_SCOPED_STORAGE = Build.VERSION.SDK_INT <= 29;
27-
public static int BUILD_VERSION = 3341;
28-
public static String BUILD_VERSION_STRING = "9.6.2";
27+
public static int BUILD_VERSION = 3343;
28+
public static String BUILD_VERSION_STRING = "9.6.3";
2929
public static int APP_ID = 4;
3030
public static String APP_HASH = "014b35b6184100b085b0d0572f9b5103";
3131

‎TMessagesProj/src/main/java/org/telegram/messenger/FileLoader.java

+11-13
Original file line numberDiff line numberDiff line change
@@ -801,11 +801,8 @@ private FileLoadOperation loadFileInternal(final TLRPC.Document document, final
801801
public void didPreFinishLoading(FileLoadOperation operation, File finalFile) {
802802
FileLoaderPriorityQueue queue = operation.getQueue();
803803
fileLoaderQueue.postRunnable(() -> {
804-
FileLoadOperation currentOperation = loadOperationPaths.get(fileName);
805-
if (currentOperation != null) {
806-
currentOperation.preFinished = true;
807-
queue.checkLoadingOperations();
808-
}
804+
operation.preFinished = true;
805+
queue.checkLoadingOperations();
809806
});
810807
}
811808

@@ -832,13 +829,13 @@ public void didFinishLoadingFile(FileLoadOperation operation, File finalFile) {
832829
}
833830
}
834831

835-
checkDownloadQueue(operation.getQueue(), fileName, 100);
832+
checkDownloadQueue(operation, operation.getQueue(), 100);
836833
}
837834

838835
@Override
839836
public void didFailedLoadingFile(FileLoadOperation operation, int reason) {
840837
loadOperationPathsUI.remove(fileName);
841-
checkDownloadQueue(operation.getQueue(), fileName);
838+
checkDownloadQueue(operation, operation.getQueue());
842839
if (delegate != null) {
843840
delegate.fileDidFailedLoad(fileName, reason);
844841
}
@@ -986,15 +983,16 @@ protected FileLoadOperation loadStreamFile(final FileLoadOperationStream stream,
986983
return result[0];
987984
}
988985

989-
private void checkDownloadQueue(FileLoaderPriorityQueue queue, String fileName) {
990-
checkDownloadQueue(queue, fileName, 0);
986+
private void checkDownloadQueue(FileLoadOperation operation, FileLoaderPriorityQueue queue) {
987+
checkDownloadQueue(operation, queue, 0);
991988
}
992989

993-
private void checkDownloadQueue(FileLoaderPriorityQueue queue, String fileName, long delay) {
990+
private void checkDownloadQueue(FileLoadOperation operation, FileLoaderPriorityQueue queue, long delay) {
994991
fileLoaderQueue.postRunnable(() -> {
995-
FileLoadOperation operation = loadOperationPaths.remove(fileName);
996-
queue.remove(operation);
997-
queue.checkLoadingOperations();
992+
if (queue.remove(operation)) {
993+
loadOperationPaths.remove(operation.getFileName());
994+
queue.checkLoadingOperations();
995+
}
998996
}, delay);
999997
}
1000998

‎TMessagesProj/src/main/java/org/telegram/messenger/FileLoaderPriorityQueue.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,11 @@ public void checkLoadingOperations() {
8383
}
8484
}
8585

86-
public void remove(FileLoadOperation operation) {
86+
public boolean remove(FileLoadOperation operation) {
8787
if (operation == null) {
88-
return;
88+
return false;
8989
}
90-
allOperations.remove(operation);
90+
return allOperations.remove(operation);
9191
}
9292

9393
public int getCount() {

‎TMessagesProj/src/main/java/org/telegram/messenger/MediaDataController.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -6954,8 +6954,8 @@ public void onRingtoneUploaded(String filePath, TLRPC.Document document, boolean
69546954
ringtoneDataStore.onRingtoneUploaded(filePath, document, error);
69556955
}
69566956

6957-
public void checkRingtones() {
6958-
ringtoneDataStore.loadUserRingtones();
6957+
public void checkRingtones(boolean force) {
6958+
ringtoneDataStore.loadUserRingtones(force);
69596959
}
69606960

69616961
public boolean saveToRingtones(TLRPC.Document document) {

‎TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -15871,7 +15871,7 @@ public boolean processUpdateArray(ArrayList<TLRPC.Update> updates, ArrayList<TLR
1587115871
TLRPC.TL_updatePendingJoinRequests update = (TLRPC.TL_updatePendingJoinRequests) baseUpdate;
1587215872
getMemberRequestsController().onPendingRequestsUpdated(update);
1587315873
} else if (baseUpdate instanceof TLRPC.TL_updateSavedRingtones) {
15874-
getMediaDataController().ringtoneDataStore.loadUserRingtones();
15874+
getMediaDataController().ringtoneDataStore.loadUserRingtones(true);
1587515875
} else if (baseUpdate instanceof TLRPC.TL_updateTranscribeAudio) {
1587615876
FileLog.e("Received legacy TL_updateTranscribeAudio update");
1587715877
} else if (baseUpdate instanceof TLRPC.TL_updateTranscribedAudio) {

‎TMessagesProj/src/main/java/org/telegram/messenger/NotificationsSettingsFacade.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ public void applySoundSettings(TLRPC.NotificationSound settings, SharedPreferenc
236236
} else if (settings instanceof TLRPC.TL_notificationSoundRingtone) {
237237
TLRPC.TL_notificationSoundRingtone soundRingtone = (TLRPC.TL_notificationSoundRingtone) settings;
238238
editor.putLong(soundDocPref, soundRingtone.id);
239-
MediaDataController.getInstance(currentAccount).checkRingtones();
239+
MediaDataController.getInstance(currentAccount).checkRingtones(true);
240240
if (serverUpdate && dialogId != 0) {
241241
editor.putBoolean("custom_" + dialogId, true);
242242
}

‎TMessagesProj/src/main/java/org/telegram/messenger/ringtone/RingtoneDataStore.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ public RingtoneDataStore(int currentAccount) {
5050
FileLog.e(e);
5151
}
5252
AndroidUtilities.runOnUIThread(() -> {
53-
loadUserRingtones();
53+
loadUserRingtones(false);
5454
});
5555
}
5656

57-
public void loadUserRingtones() {
58-
boolean needReload = System.currentTimeMillis() - lastReloadTimeMs > reloadTimeoutMs;
57+
public void loadUserRingtones(boolean force) {
58+
boolean needReload = force || System.currentTimeMillis() - lastReloadTimeMs > reloadTimeoutMs;
5959
TLRPC.TL_account_getSavedRingtones req = new TLRPC.TL_account_getSavedRingtones();
6060
req.hash = queryHash;
6161
if (needReload) {

‎TMessagesProj/src/main/java/org/telegram/ui/CachedMediaLayout.java

+1
Original file line numberDiff line numberDiff line change
@@ -836,6 +836,7 @@ private void checkMessageObjectForAudio(CacheModel.FileInfo fileInfo, int positi
836836
message.media.flags |= 3;
837837
message.media.document = new TLRPC.TL_document();
838838
message.flags |= TLRPC.MESSAGE_FLAG_HAS_MEDIA | TLRPC.MESSAGE_FLAG_HAS_FROM_ID;
839+
message.dialog_id = fileInfo.dialogId;
839840

840841
String ext = FileLoader.getFileExtension(fileInfo.file);
841842

‎TMessagesProj/src/main/java/org/telegram/ui/Cells/DrawerActionCell.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ protected void onDraw(Canvas canvas) {
7676
if (suggestions.contains("VALIDATE_PHONE_NUMBER") || suggestions.contains("VALIDATE_PASSWORD")) {
7777
int countTop = AndroidUtilities.dp(12.5f);
7878
int countWidth = AndroidUtilities.dp(9);
79-
int countLeft = getMeasuredWidth() - countWidth - AndroidUtilities.dp(25);
79+
int countLeft = LocaleController.isRTL ? countWidth + AndroidUtilities.dp(25) : getMeasuredWidth() - countWidth - AndroidUtilities.dp(25);
8080

8181
int x = countLeft - AndroidUtilities.dp(5.5f);
8282
rect.set(x, countTop, x + countWidth + AndroidUtilities.dp(14), countTop + AndroidUtilities.dp(23));

‎TMessagesProj/src/main/java/org/telegram/ui/Components/AudioPlayerAlert.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -2010,7 +2010,13 @@ private void updateTitle(boolean shutdown) {
20102010
} else {
20112011
optionsButton.setVisibility(View.VISIBLE);
20122012
}
2013-
if (MessagesController.getInstance(currentAccount).isChatNoForwards(messageObject.getChatId())) {
2013+
final long dialogId = messageObject.getDialogId();
2014+
final boolean noforwards = (
2015+
dialogId < 0 && MessagesController.getInstance(currentAccount).isChatNoForwards(-dialogId) ||
2016+
MessagesController.getInstance(currentAccount).isChatNoForwards(messageObject.getChatId()) ||
2017+
messageObject.messageOwner.noforwards
2018+
);
2019+
if (noforwards) {
20142020
optionsButton.hideSubItem(1);
20152021
optionsButton.hideSubItem(2);
20162022
optionsButton.hideSubItem(5);

‎TMessagesProj/src/main/java/org/telegram/ui/NotificationsSoundActivity.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ private void updateActionMode() {
442442
}
443443

444444
private void loadTones() {
445-
getMediaDataController().ringtoneDataStore.loadUserRingtones();
445+
getMediaDataController().ringtoneDataStore.loadUserRingtones(false);
446446
serverTones.clear();
447447
systemTones.clear();
448448

‎gradle.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
1414
# org.gradle.parallel=true
1515
#Sat Mar 12 05:53:50 MSK 2016
16-
APP_VERSION_CODE=3341
17-
APP_VERSION_NAME=9.6.2
16+
APP_VERSION_CODE=3343
17+
APP_VERSION_NAME=9.6.3
1818
APP_PACKAGE=org.telegram.messenger
1919
RELEASE_KEY_PASSWORD=android
2020
RELEASE_KEY_ALIAS=androidkey

0 commit comments

Comments
 (0)