update to 9.6.3

This commit is contained in:
xaxtix 2023-04-28 01:46:46 +04:00
parent 3c9a4c1f1f
commit e77ac040c6
14 changed files with 64 additions and 57 deletions

View file

@ -18,7 +18,7 @@
#define USE_DEBUG_SESSION false #define USE_DEBUG_SESSION false
#define READ_BUFFER_SIZE 1024 * 1024 * 2 #define READ_BUFFER_SIZE 1024 * 1024 * 2
//#define DEBUG_VERSION #define DEBUG_VERSION
#define PFS_ENABLED 1 #define PFS_ENABLED 1
#define DEFAULT_DATACENTER_ID INT_MAX #define DEFAULT_DATACENTER_ID INT_MAX
#define DC_UPDATE_TIME 60 * 60 #define DC_UPDATE_TIME 60 * 60

View file

@ -940,32 +940,33 @@ void Handshake::loadCdnConfig(Datacenter *datacenter) {
if (loadingCdnKeys) { if (loadingCdnKeys) {
return; return;
} }
if (cdnPublicKeysFingerprints.empty()) { if (LOGS_ENABLED) DEBUG_D("account%u dc%u loadCdnConfig", datacenter->instanceNum, datacenter->datacenterId);
if (cdnConfig == nullptr) { // if (cdnPublicKeysFingerprints.empty()) {
cdnConfig = new Config(datacenter->instanceNum, "cdnkeys.dat"); // if (cdnConfig == nullptr) {
} // cdnConfig = new Config(datacenter->instanceNum, "cdnkeys.dat");
NativeByteBuffer *buffer = cdnConfig->readConfig(); // }
if (buffer != nullptr) { // NativeByteBuffer *buffer = cdnConfig->readConfig();
uint32_t version = buffer->readUint32(nullptr); // if (buffer != nullptr) {
if (version >= 1) { // uint32_t version = buffer->readUint32(nullptr);
size_t count = buffer->readUint32(nullptr); // if (version >= 1) {
for (uint32_t a = 0; a < count; a++) { // size_t count = buffer->readUint32(nullptr);
int dcId = buffer->readInt32(nullptr); // for (uint32_t a = 0; a < count; a++) {
cdnPublicKeys[dcId] = buffer->readString(nullptr); // int dcId = buffer->readInt32(nullptr);
cdnPublicKeysFingerprints[dcId] = buffer->readUint64(nullptr); // cdnPublicKeys[dcId] = buffer->readString(nullptr);
} // cdnPublicKeysFingerprints[dcId] = buffer->readUint64(nullptr);
} // }
buffer->reuse(); // }
if (!cdnPublicKeysFingerprints.empty()) { // buffer->reuse();
size_t count = cdnWaitingDatacenters.size(); // if (!cdnPublicKeysFingerprints.empty()) {
for (uint32_t a = 0; a < count; a++) { // size_t count = cdnWaitingDatacenters.size();
cdnWaitingDatacenters[a]->beginHandshake(HandshakeTypeCurrent, false); // for (uint32_t a = 0; a < count; a++) {
} // cdnWaitingDatacenters[a]->beginHandshake(HandshakeTypeCurrent, false);
cdnWaitingDatacenters.clear(); // }
return; // cdnWaitingDatacenters.clear();
} // return;
} // }
} // }
// }
loadingCdnKeys = true; loadingCdnKeys = true;
auto request = new TL_help_getCdnConfig(); auto request = new TL_help_getCdnConfig();
@ -1008,6 +1009,7 @@ void Handshake::loadCdnConfig(Datacenter *datacenter) {
buffer->reuse(); buffer->reuse();
BIO_free(keyBio); BIO_free(keyBio);
count = cdnWaitingDatacenters.size(); count = cdnWaitingDatacenters.size();
if (LOGS_ENABLED) DEBUG_D("account%u dc%u cdnConfig loaded begin handshake", datacenter->instanceNum, datacenter->datacenterId);
for (uint32_t a = 0; a < count; a++) { for (uint32_t a = 0; a < count; a++) {
cdnWaitingDatacenters[a]->beginHandshake(HandshakeTypeCurrent, false); cdnWaitingDatacenters[a]->beginHandshake(HandshakeTypeCurrent, false);
} }

View file

@ -24,8 +24,8 @@ public class BuildVars {
public static boolean USE_CLOUD_STRINGS = true; public static boolean USE_CLOUD_STRINGS = true;
public static boolean CHECK_UPDATES = true; public static boolean CHECK_UPDATES = true;
public static boolean NO_SCOPED_STORAGE = Build.VERSION.SDK_INT <= 29; public static boolean NO_SCOPED_STORAGE = Build.VERSION.SDK_INT <= 29;
public static int BUILD_VERSION = 3341; public static int BUILD_VERSION = 3343;
public static String BUILD_VERSION_STRING = "9.6.2"; public static String BUILD_VERSION_STRING = "9.6.3";
public static int APP_ID = 4; public static int APP_ID = 4;
public static String APP_HASH = "014b35b6184100b085b0d0572f9b5103"; public static String APP_HASH = "014b35b6184100b085b0d0572f9b5103";

View file

@ -801,11 +801,8 @@ public class FileLoader extends BaseController {
public void didPreFinishLoading(FileLoadOperation operation, File finalFile) { public void didPreFinishLoading(FileLoadOperation operation, File finalFile) {
FileLoaderPriorityQueue queue = operation.getQueue(); FileLoaderPriorityQueue queue = operation.getQueue();
fileLoaderQueue.postRunnable(() -> { fileLoaderQueue.postRunnable(() -> {
FileLoadOperation currentOperation = loadOperationPaths.get(fileName); operation.preFinished = true;
if (currentOperation != null) {
currentOperation.preFinished = true;
queue.checkLoadingOperations(); queue.checkLoadingOperations();
}
}); });
} }
@ -832,13 +829,13 @@ public class FileLoader extends BaseController {
} }
} }
checkDownloadQueue(operation.getQueue(), fileName, 100); checkDownloadQueue(operation, operation.getQueue(), 100);
} }
@Override @Override
public void didFailedLoadingFile(FileLoadOperation operation, int reason) { public void didFailedLoadingFile(FileLoadOperation operation, int reason) {
loadOperationPathsUI.remove(fileName); loadOperationPathsUI.remove(fileName);
checkDownloadQueue(operation.getQueue(), fileName); checkDownloadQueue(operation, operation.getQueue());
if (delegate != null) { if (delegate != null) {
delegate.fileDidFailedLoad(fileName, reason); delegate.fileDidFailedLoad(fileName, reason);
} }
@ -986,15 +983,16 @@ public class FileLoader extends BaseController {
return result[0]; return result[0];
} }
private void checkDownloadQueue(FileLoaderPriorityQueue queue, String fileName) { private void checkDownloadQueue(FileLoadOperation operation, FileLoaderPriorityQueue queue) {
checkDownloadQueue(queue, fileName, 0); checkDownloadQueue(operation, queue, 0);
} }
private void checkDownloadQueue(FileLoaderPriorityQueue queue, String fileName, long delay) { private void checkDownloadQueue(FileLoadOperation operation, FileLoaderPriorityQueue queue, long delay) {
fileLoaderQueue.postRunnable(() -> { fileLoaderQueue.postRunnable(() -> {
FileLoadOperation operation = loadOperationPaths.remove(fileName); if (queue.remove(operation)) {
queue.remove(operation); loadOperationPaths.remove(operation.getFileName());
queue.checkLoadingOperations(); queue.checkLoadingOperations();
}
}, delay); }, delay);
} }

View file

@ -83,11 +83,11 @@ public class FileLoaderPriorityQueue {
} }
} }
public void remove(FileLoadOperation operation) { public boolean remove(FileLoadOperation operation) {
if (operation == null) { if (operation == null) {
return; return false;
} }
allOperations.remove(operation); return allOperations.remove(operation);
} }
public int getCount() { public int getCount() {

View file

@ -6954,8 +6954,8 @@ public class MediaDataController extends BaseController {
ringtoneDataStore.onRingtoneUploaded(filePath, document, error); ringtoneDataStore.onRingtoneUploaded(filePath, document, error);
} }
public void checkRingtones() { public void checkRingtones(boolean force) {
ringtoneDataStore.loadUserRingtones(); ringtoneDataStore.loadUserRingtones(force);
} }
public boolean saveToRingtones(TLRPC.Document document) { public boolean saveToRingtones(TLRPC.Document document) {

View file

@ -15871,7 +15871,7 @@ public class MessagesController extends BaseController implements NotificationCe
TLRPC.TL_updatePendingJoinRequests update = (TLRPC.TL_updatePendingJoinRequests) baseUpdate; TLRPC.TL_updatePendingJoinRequests update = (TLRPC.TL_updatePendingJoinRequests) baseUpdate;
getMemberRequestsController().onPendingRequestsUpdated(update); getMemberRequestsController().onPendingRequestsUpdated(update);
} else if (baseUpdate instanceof TLRPC.TL_updateSavedRingtones) { } else if (baseUpdate instanceof TLRPC.TL_updateSavedRingtones) {
getMediaDataController().ringtoneDataStore.loadUserRingtones(); getMediaDataController().ringtoneDataStore.loadUserRingtones(true);
} else if (baseUpdate instanceof TLRPC.TL_updateTranscribeAudio) { } else if (baseUpdate instanceof TLRPC.TL_updateTranscribeAudio) {
FileLog.e("Received legacy TL_updateTranscribeAudio update"); FileLog.e("Received legacy TL_updateTranscribeAudio update");
} else if (baseUpdate instanceof TLRPC.TL_updateTranscribedAudio) { } else if (baseUpdate instanceof TLRPC.TL_updateTranscribedAudio) {

View file

@ -236,7 +236,7 @@ public class NotificationsSettingsFacade {
} else if (settings instanceof TLRPC.TL_notificationSoundRingtone) { } else if (settings instanceof TLRPC.TL_notificationSoundRingtone) {
TLRPC.TL_notificationSoundRingtone soundRingtone = (TLRPC.TL_notificationSoundRingtone) settings; TLRPC.TL_notificationSoundRingtone soundRingtone = (TLRPC.TL_notificationSoundRingtone) settings;
editor.putLong(soundDocPref, soundRingtone.id); editor.putLong(soundDocPref, soundRingtone.id);
MediaDataController.getInstance(currentAccount).checkRingtones(); MediaDataController.getInstance(currentAccount).checkRingtones(true);
if (serverUpdate && dialogId != 0) { if (serverUpdate && dialogId != 0) {
editor.putBoolean("custom_" + dialogId, true); editor.putBoolean("custom_" + dialogId, true);
} }

View file

@ -50,12 +50,12 @@ public class RingtoneDataStore {
FileLog.e(e); FileLog.e(e);
} }
AndroidUtilities.runOnUIThread(() -> { AndroidUtilities.runOnUIThread(() -> {
loadUserRingtones(); loadUserRingtones(false);
}); });
} }
public void loadUserRingtones() { public void loadUserRingtones(boolean force) {
boolean needReload = System.currentTimeMillis() - lastReloadTimeMs > reloadTimeoutMs; boolean needReload = force || System.currentTimeMillis() - lastReloadTimeMs > reloadTimeoutMs;
TLRPC.TL_account_getSavedRingtones req = new TLRPC.TL_account_getSavedRingtones(); TLRPC.TL_account_getSavedRingtones req = new TLRPC.TL_account_getSavedRingtones();
req.hash = queryHash; req.hash = queryHash;
if (needReload) { if (needReload) {

View file

@ -836,6 +836,7 @@ public class CachedMediaLayout extends FrameLayout implements NestedSizeNotifier
message.media.flags |= 3; message.media.flags |= 3;
message.media.document = new TLRPC.TL_document(); message.media.document = new TLRPC.TL_document();
message.flags |= TLRPC.MESSAGE_FLAG_HAS_MEDIA | TLRPC.MESSAGE_FLAG_HAS_FROM_ID; message.flags |= TLRPC.MESSAGE_FLAG_HAS_MEDIA | TLRPC.MESSAGE_FLAG_HAS_FROM_ID;
message.dialog_id = fileInfo.dialogId;
String ext = FileLoader.getFileExtension(fileInfo.file); String ext = FileLoader.getFileExtension(fileInfo.file);

View file

@ -76,7 +76,7 @@ public class DrawerActionCell extends FrameLayout {
if (suggestions.contains("VALIDATE_PHONE_NUMBER") || suggestions.contains("VALIDATE_PASSWORD")) { if (suggestions.contains("VALIDATE_PHONE_NUMBER") || suggestions.contains("VALIDATE_PASSWORD")) {
int countTop = AndroidUtilities.dp(12.5f); int countTop = AndroidUtilities.dp(12.5f);
int countWidth = AndroidUtilities.dp(9); int countWidth = AndroidUtilities.dp(9);
int countLeft = getMeasuredWidth() - countWidth - AndroidUtilities.dp(25); int countLeft = LocaleController.isRTL ? countWidth + AndroidUtilities.dp(25) : getMeasuredWidth() - countWidth - AndroidUtilities.dp(25);
int x = countLeft - AndroidUtilities.dp(5.5f); int x = countLeft - AndroidUtilities.dp(5.5f);
rect.set(x, countTop, x + countWidth + AndroidUtilities.dp(14), countTop + AndroidUtilities.dp(23)); rect.set(x, countTop, x + countWidth + AndroidUtilities.dp(14), countTop + AndroidUtilities.dp(23));

View file

@ -2010,7 +2010,13 @@ public class AudioPlayerAlert extends BottomSheet implements NotificationCenter.
} else { } else {
optionsButton.setVisibility(View.VISIBLE); optionsButton.setVisibility(View.VISIBLE);
} }
if (MessagesController.getInstance(currentAccount).isChatNoForwards(messageObject.getChatId())) { final long dialogId = messageObject.getDialogId();
final boolean noforwards = (
dialogId < 0 && MessagesController.getInstance(currentAccount).isChatNoForwards(-dialogId) ||
MessagesController.getInstance(currentAccount).isChatNoForwards(messageObject.getChatId()) ||
messageObject.messageOwner.noforwards
);
if (noforwards) {
optionsButton.hideSubItem(1); optionsButton.hideSubItem(1);
optionsButton.hideSubItem(2); optionsButton.hideSubItem(2);
optionsButton.hideSubItem(5); optionsButton.hideSubItem(5);

View file

@ -442,7 +442,7 @@ public class NotificationsSoundActivity extends BaseFragment implements ChatAtta
} }
private void loadTones() { private void loadTones() {
getMediaDataController().ringtoneDataStore.loadUserRingtones(); getMediaDataController().ringtoneDataStore.loadUserRingtones(false);
serverTones.clear(); serverTones.clear();
systemTones.clear(); systemTones.clear();

View file

@ -13,8 +13,8 @@
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true # org.gradle.parallel=true
#Sat Mar 12 05:53:50 MSK 2016 #Sat Mar 12 05:53:50 MSK 2016
APP_VERSION_CODE=3341 APP_VERSION_CODE=3343
APP_VERSION_NAME=9.6.2 APP_VERSION_NAME=9.6.3
APP_PACKAGE=org.telegram.messenger APP_PACKAGE=org.telegram.messenger
RELEASE_KEY_PASSWORD=android RELEASE_KEY_PASSWORD=android
RELEASE_KEY_ALIAS=androidkey RELEASE_KEY_ALIAS=androidkey