mirror of
https://github.com/DrKLO/Telegram.git
synced 2024-12-21 22:15:16 +01:00
update to 9.6.3
This commit is contained in:
parent
3c9a4c1f1f
commit
e77ac040c6
14 changed files with 64 additions and 57 deletions
|
@ -18,7 +18,7 @@
|
|||
|
||||
#define USE_DEBUG_SESSION false
|
||||
#define READ_BUFFER_SIZE 1024 * 1024 * 2
|
||||
//#define DEBUG_VERSION
|
||||
#define DEBUG_VERSION
|
||||
#define PFS_ENABLED 1
|
||||
#define DEFAULT_DATACENTER_ID INT_MAX
|
||||
#define DC_UPDATE_TIME 60 * 60
|
||||
|
|
|
@ -940,32 +940,33 @@ void Handshake::loadCdnConfig(Datacenter *datacenter) {
|
|||
if (loadingCdnKeys) {
|
||||
return;
|
||||
}
|
||||
if (cdnPublicKeysFingerprints.empty()) {
|
||||
if (cdnConfig == nullptr) {
|
||||
cdnConfig = new Config(datacenter->instanceNum, "cdnkeys.dat");
|
||||
}
|
||||
NativeByteBuffer *buffer = cdnConfig->readConfig();
|
||||
if (buffer != nullptr) {
|
||||
uint32_t version = buffer->readUint32(nullptr);
|
||||
if (version >= 1) {
|
||||
size_t count = buffer->readUint32(nullptr);
|
||||
for (uint32_t a = 0; a < count; a++) {
|
||||
int dcId = buffer->readInt32(nullptr);
|
||||
cdnPublicKeys[dcId] = buffer->readString(nullptr);
|
||||
cdnPublicKeysFingerprints[dcId] = buffer->readUint64(nullptr);
|
||||
}
|
||||
}
|
||||
buffer->reuse();
|
||||
if (!cdnPublicKeysFingerprints.empty()) {
|
||||
size_t count = cdnWaitingDatacenters.size();
|
||||
for (uint32_t a = 0; a < count; a++) {
|
||||
cdnWaitingDatacenters[a]->beginHandshake(HandshakeTypeCurrent, false);
|
||||
}
|
||||
cdnWaitingDatacenters.clear();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (LOGS_ENABLED) DEBUG_D("account%u dc%u loadCdnConfig", datacenter->instanceNum, datacenter->datacenterId);
|
||||
// if (cdnPublicKeysFingerprints.empty()) {
|
||||
// if (cdnConfig == nullptr) {
|
||||
// cdnConfig = new Config(datacenter->instanceNum, "cdnkeys.dat");
|
||||
// }
|
||||
// NativeByteBuffer *buffer = cdnConfig->readConfig();
|
||||
// if (buffer != nullptr) {
|
||||
// uint32_t version = buffer->readUint32(nullptr);
|
||||
// if (version >= 1) {
|
||||
// size_t count = buffer->readUint32(nullptr);
|
||||
// for (uint32_t a = 0; a < count; a++) {
|
||||
// int dcId = buffer->readInt32(nullptr);
|
||||
// cdnPublicKeys[dcId] = buffer->readString(nullptr);
|
||||
// cdnPublicKeysFingerprints[dcId] = buffer->readUint64(nullptr);
|
||||
// }
|
||||
// }
|
||||
// buffer->reuse();
|
||||
// if (!cdnPublicKeysFingerprints.empty()) {
|
||||
// size_t count = cdnWaitingDatacenters.size();
|
||||
// for (uint32_t a = 0; a < count; a++) {
|
||||
// cdnWaitingDatacenters[a]->beginHandshake(HandshakeTypeCurrent, false);
|
||||
// }
|
||||
// cdnWaitingDatacenters.clear();
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
loadingCdnKeys = true;
|
||||
auto request = new TL_help_getCdnConfig();
|
||||
|
||||
|
@ -1008,6 +1009,7 @@ void Handshake::loadCdnConfig(Datacenter *datacenter) {
|
|||
buffer->reuse();
|
||||
BIO_free(keyBio);
|
||||
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++) {
|
||||
cdnWaitingDatacenters[a]->beginHandshake(HandshakeTypeCurrent, false);
|
||||
}
|
||||
|
|
|
@ -24,8 +24,8 @@ public class BuildVars {
|
|||
public static boolean USE_CLOUD_STRINGS = true;
|
||||
public static boolean CHECK_UPDATES = true;
|
||||
public static boolean NO_SCOPED_STORAGE = Build.VERSION.SDK_INT <= 29;
|
||||
public static int BUILD_VERSION = 3341;
|
||||
public static String BUILD_VERSION_STRING = "9.6.2";
|
||||
public static int BUILD_VERSION = 3343;
|
||||
public static String BUILD_VERSION_STRING = "9.6.3";
|
||||
public static int APP_ID = 4;
|
||||
public static String APP_HASH = "014b35b6184100b085b0d0572f9b5103";
|
||||
|
||||
|
|
|
@ -801,11 +801,8 @@ public class FileLoader extends BaseController {
|
|||
public void didPreFinishLoading(FileLoadOperation operation, File finalFile) {
|
||||
FileLoaderPriorityQueue queue = operation.getQueue();
|
||||
fileLoaderQueue.postRunnable(() -> {
|
||||
FileLoadOperation currentOperation = loadOperationPaths.get(fileName);
|
||||
if (currentOperation != null) {
|
||||
currentOperation.preFinished = true;
|
||||
queue.checkLoadingOperations();
|
||||
}
|
||||
operation.preFinished = true;
|
||||
queue.checkLoadingOperations();
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -832,13 +829,13 @@ public class FileLoader extends BaseController {
|
|||
}
|
||||
}
|
||||
|
||||
checkDownloadQueue(operation.getQueue(), fileName, 100);
|
||||
checkDownloadQueue(operation, operation.getQueue(), 100);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void didFailedLoadingFile(FileLoadOperation operation, int reason) {
|
||||
loadOperationPathsUI.remove(fileName);
|
||||
checkDownloadQueue(operation.getQueue(), fileName);
|
||||
checkDownloadQueue(operation, operation.getQueue());
|
||||
if (delegate != null) {
|
||||
delegate.fileDidFailedLoad(fileName, reason);
|
||||
}
|
||||
|
@ -986,15 +983,16 @@ public class FileLoader extends BaseController {
|
|||
return result[0];
|
||||
}
|
||||
|
||||
private void checkDownloadQueue(FileLoaderPriorityQueue queue, String fileName) {
|
||||
checkDownloadQueue(queue, fileName, 0);
|
||||
private void checkDownloadQueue(FileLoadOperation operation, FileLoaderPriorityQueue queue) {
|
||||
checkDownloadQueue(operation, queue, 0);
|
||||
}
|
||||
|
||||
private void checkDownloadQueue(FileLoaderPriorityQueue queue, String fileName, long delay) {
|
||||
private void checkDownloadQueue(FileLoadOperation operation, FileLoaderPriorityQueue queue, long delay) {
|
||||
fileLoaderQueue.postRunnable(() -> {
|
||||
FileLoadOperation operation = loadOperationPaths.remove(fileName);
|
||||
queue.remove(operation);
|
||||
queue.checkLoadingOperations();
|
||||
if (queue.remove(operation)) {
|
||||
loadOperationPaths.remove(operation.getFileName());
|
||||
queue.checkLoadingOperations();
|
||||
}
|
||||
}, delay);
|
||||
}
|
||||
|
||||
|
|
|
@ -83,11 +83,11 @@ public class FileLoaderPriorityQueue {
|
|||
}
|
||||
}
|
||||
|
||||
public void remove(FileLoadOperation operation) {
|
||||
public boolean remove(FileLoadOperation operation) {
|
||||
if (operation == null) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
allOperations.remove(operation);
|
||||
return allOperations.remove(operation);
|
||||
}
|
||||
|
||||
public int getCount() {
|
||||
|
|
|
@ -6954,8 +6954,8 @@ public class MediaDataController extends BaseController {
|
|||
ringtoneDataStore.onRingtoneUploaded(filePath, document, error);
|
||||
}
|
||||
|
||||
public void checkRingtones() {
|
||||
ringtoneDataStore.loadUserRingtones();
|
||||
public void checkRingtones(boolean force) {
|
||||
ringtoneDataStore.loadUserRingtones(force);
|
||||
}
|
||||
|
||||
public boolean saveToRingtones(TLRPC.Document document) {
|
||||
|
|
|
@ -15871,7 +15871,7 @@ public class MessagesController extends BaseController implements NotificationCe
|
|||
TLRPC.TL_updatePendingJoinRequests update = (TLRPC.TL_updatePendingJoinRequests) baseUpdate;
|
||||
getMemberRequestsController().onPendingRequestsUpdated(update);
|
||||
} else if (baseUpdate instanceof TLRPC.TL_updateSavedRingtones) {
|
||||
getMediaDataController().ringtoneDataStore.loadUserRingtones();
|
||||
getMediaDataController().ringtoneDataStore.loadUserRingtones(true);
|
||||
} else if (baseUpdate instanceof TLRPC.TL_updateTranscribeAudio) {
|
||||
FileLog.e("Received legacy TL_updateTranscribeAudio update");
|
||||
} else if (baseUpdate instanceof TLRPC.TL_updateTranscribedAudio) {
|
||||
|
|
|
@ -236,7 +236,7 @@ public class NotificationsSettingsFacade {
|
|||
} else if (settings instanceof TLRPC.TL_notificationSoundRingtone) {
|
||||
TLRPC.TL_notificationSoundRingtone soundRingtone = (TLRPC.TL_notificationSoundRingtone) settings;
|
||||
editor.putLong(soundDocPref, soundRingtone.id);
|
||||
MediaDataController.getInstance(currentAccount).checkRingtones();
|
||||
MediaDataController.getInstance(currentAccount).checkRingtones(true);
|
||||
if (serverUpdate && dialogId != 0) {
|
||||
editor.putBoolean("custom_" + dialogId, true);
|
||||
}
|
||||
|
|
|
@ -50,12 +50,12 @@ public class RingtoneDataStore {
|
|||
FileLog.e(e);
|
||||
}
|
||||
AndroidUtilities.runOnUIThread(() -> {
|
||||
loadUserRingtones();
|
||||
loadUserRingtones(false);
|
||||
});
|
||||
}
|
||||
|
||||
public void loadUserRingtones() {
|
||||
boolean needReload = System.currentTimeMillis() - lastReloadTimeMs > reloadTimeoutMs;
|
||||
public void loadUserRingtones(boolean force) {
|
||||
boolean needReload = force || System.currentTimeMillis() - lastReloadTimeMs > reloadTimeoutMs;
|
||||
TLRPC.TL_account_getSavedRingtones req = new TLRPC.TL_account_getSavedRingtones();
|
||||
req.hash = queryHash;
|
||||
if (needReload) {
|
||||
|
|
|
@ -836,6 +836,7 @@ public class CachedMediaLayout extends FrameLayout implements NestedSizeNotifier
|
|||
message.media.flags |= 3;
|
||||
message.media.document = new TLRPC.TL_document();
|
||||
message.flags |= TLRPC.MESSAGE_FLAG_HAS_MEDIA | TLRPC.MESSAGE_FLAG_HAS_FROM_ID;
|
||||
message.dialog_id = fileInfo.dialogId;
|
||||
|
||||
String ext = FileLoader.getFileExtension(fileInfo.file);
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ public class DrawerActionCell extends FrameLayout {
|
|||
if (suggestions.contains("VALIDATE_PHONE_NUMBER") || suggestions.contains("VALIDATE_PASSWORD")) {
|
||||
int countTop = AndroidUtilities.dp(12.5f);
|
||||
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);
|
||||
rect.set(x, countTop, x + countWidth + AndroidUtilities.dp(14), countTop + AndroidUtilities.dp(23));
|
||||
|
|
|
@ -2010,7 +2010,13 @@ public class AudioPlayerAlert extends BottomSheet implements NotificationCenter.
|
|||
} else {
|
||||
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(2);
|
||||
optionsButton.hideSubItem(5);
|
||||
|
|
|
@ -442,7 +442,7 @@ public class NotificationsSoundActivity extends BaseFragment implements ChatAtta
|
|||
}
|
||||
|
||||
private void loadTones() {
|
||||
getMediaDataController().ringtoneDataStore.loadUserRingtones();
|
||||
getMediaDataController().ringtoneDataStore.loadUserRingtones(false);
|
||||
serverTones.clear();
|
||||
systemTones.clear();
|
||||
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||
# org.gradle.parallel=true
|
||||
#Sat Mar 12 05:53:50 MSK 2016
|
||||
APP_VERSION_CODE=3341
|
||||
APP_VERSION_NAME=9.6.2
|
||||
APP_VERSION_CODE=3343
|
||||
APP_VERSION_NAME=9.6.3
|
||||
APP_PACKAGE=org.telegram.messenger
|
||||
RELEASE_KEY_PASSWORD=android
|
||||
RELEASE_KEY_ALIAS=androidkey
|
||||
|
|
Loading…
Reference in a new issue