mirror of
https://github.com/DrKLO/Telegram.git
synced 2024-12-22 14:35:03 +01:00
Update to 5.15.0 (1869)
This commit is contained in:
parent
dae819b5a3
commit
df90eface5
7 changed files with 54 additions and 5 deletions
|
@ -283,7 +283,7 @@ android {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultConfig.versionCode = 1868
|
defaultConfig.versionCode = 1869
|
||||||
|
|
||||||
applicationVariants.all { variant ->
|
applicationVariants.all { variant ->
|
||||||
variant.outputs.all { output ->
|
variant.outputs.all { output ->
|
||||||
|
|
|
@ -3074,7 +3074,7 @@ static void initMachTimestart() {
|
||||||
double VoIPController::GetCurrentTime(){
|
double VoIPController::GetCurrentTime(){
|
||||||
#if defined(__linux__)
|
#if defined(__linux__)
|
||||||
struct timespec ts;
|
struct timespec ts;
|
||||||
clock_gettime(CLOCK_MONOTONIC, &ts);
|
clock_gettime(CLOCK_BOOTTIME, &ts);
|
||||||
return ts.tv_sec+(double)ts.tv_nsec/1000000000.0;
|
return ts.tv_sec+(double)ts.tv_nsec/1000000000.0;
|
||||||
#elif defined(__APPLE__)
|
#elif defined(__APPLE__)
|
||||||
static pthread_once_t token = PTHREAD_ONCE_INIT;
|
static pthread_once_t token = PTHREAD_ONCE_INIT;
|
||||||
|
|
|
@ -552,7 +552,7 @@ int64_t ConnectionsManager::getCurrentTimeMillis() {
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t ConnectionsManager::getCurrentTimeMonotonicMillis() {
|
int64_t ConnectionsManager::getCurrentTimeMonotonicMillis() {
|
||||||
clock_gettime(CLOCK_MONOTONIC, &timeSpecMonotonic);
|
clock_gettime(CLOCK_BOOTTIME, &timeSpecMonotonic);
|
||||||
return (int64_t) timeSpecMonotonic.tv_sec * 1000 + (int64_t) timeSpecMonotonic.tv_nsec / 1000000;
|
return (int64_t) timeSpecMonotonic.tv_sec * 1000 + (int64_t) timeSpecMonotonic.tv_nsec / 1000000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ 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 TON_WALLET_STANDALONE = false;
|
public static boolean TON_WALLET_STANDALONE = false;
|
||||||
public static int BUILD_VERSION = 1868;
|
public static int BUILD_VERSION = 1869;
|
||||||
public static String BUILD_VERSION_STRING = "5.15.0";
|
public static String BUILD_VERSION_STRING = "5.15.0";
|
||||||
public static int APP_ID = 4;
|
public static int APP_ID = 4;
|
||||||
public static String APP_HASH = "014b35b6184100b085b0d0572f9b5103";
|
public static String APP_HASH = "014b35b6184100b085b0d0572f9b5103";
|
||||||
|
|
|
@ -7390,6 +7390,13 @@ public class MessagesStorage extends BaseController {
|
||||||
state_media.bindInteger(4, MediaDataController.getMediaType(message));
|
state_media.bindInteger(4, MediaDataController.getMediaType(message));
|
||||||
state_media.bindByteBuffer(5, data);
|
state_media.bindByteBuffer(5, data);
|
||||||
state_media.step();
|
state_media.step();
|
||||||
|
} else if (message instanceof TLRPC.TL_messageService && message.action instanceof TLRPC.TL_messageActionHistoryClear) {
|
||||||
|
try {
|
||||||
|
database.executeFast(String.format(Locale.US, "DELETE FROM media_v2 WHERE mid = %d", message.id)).stepThis().dispose();
|
||||||
|
database.executeFast("DELETE FROM media_counts_v2 WHERE uid = " + dialog_id).stepThis().dispose();
|
||||||
|
} catch (Exception e2) {
|
||||||
|
FileLog.e(e2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
data.reuse();
|
data.reuse();
|
||||||
|
|
||||||
|
|
|
@ -7211,11 +7211,14 @@ public class Theme {
|
||||||
return getDefaultColor(key);
|
return getDefaultColor(key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (key.equals(key_windowBackgroundWhite) || key.equals(key_windowBackgroundGray)) {
|
||||||
|
return 0xff000000 | color;
|
||||||
|
}
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setColor(String key, int color, boolean useDefault) {
|
public static void setColor(String key, int color, boolean useDefault) {
|
||||||
if (key.equals(key_chat_wallpaper) || key.equals(key_chat_wallpaper_gradient_to)) {
|
if (key.equals(key_chat_wallpaper) || key.equals(key_chat_wallpaper_gradient_to) || key.equals(key_windowBackgroundWhite) || key.equals(key_windowBackgroundGray)) {
|
||||||
color = 0xff000000 | color;
|
color = 0xff000000 | color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -202,6 +202,7 @@ public class SharedMediaLayout extends FrameLayout implements NotificationCenter
|
||||||
notificationCenter.addObserver(this, NotificationCenter.messageReceivedByServer);
|
notificationCenter.addObserver(this, NotificationCenter.messageReceivedByServer);
|
||||||
notificationCenter.addObserver(this, NotificationCenter.mediaDidLoad);
|
notificationCenter.addObserver(this, NotificationCenter.mediaDidLoad);
|
||||||
notificationCenter.addObserver(this, NotificationCenter.messagesDeleted);
|
notificationCenter.addObserver(this, NotificationCenter.messagesDeleted);
|
||||||
|
notificationCenter.addObserver(this, NotificationCenter.replaceMessagesObjects);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addDelegate(SharedMediaPreloaderDelegate delegate) {
|
public void addDelegate(SharedMediaPreloaderDelegate delegate) {
|
||||||
|
@ -224,6 +225,7 @@ public class SharedMediaLayout extends FrameLayout implements NotificationCenter
|
||||||
notificationCenter.removeObserver(this, NotificationCenter.messageReceivedByServer);
|
notificationCenter.removeObserver(this, NotificationCenter.messageReceivedByServer);
|
||||||
notificationCenter.removeObserver(this, NotificationCenter.mediaDidLoad);
|
notificationCenter.removeObserver(this, NotificationCenter.mediaDidLoad);
|
||||||
notificationCenter.removeObserver(this, NotificationCenter.messagesDeleted);
|
notificationCenter.removeObserver(this, NotificationCenter.messagesDeleted);
|
||||||
|
notificationCenter.removeObserver(this, NotificationCenter.replaceMessagesObjects);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int[] getLastMediaCount() {
|
public int[] getLastMediaCount() {
|
||||||
|
@ -391,6 +393,43 @@ public class SharedMediaLayout extends FrameLayout implements NotificationCenter
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
loadMediaCounts();
|
loadMediaCounts();
|
||||||
|
} else if (id == NotificationCenter.replaceMessagesObjects) {
|
||||||
|
long did = (long) args[0];
|
||||||
|
if (did != dialogId && did != mergeDialogId) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
int loadIndex = did == dialogId ? 0 : 1;
|
||||||
|
ArrayList<MessageObject> messageObjects = (ArrayList<MessageObject>) args[1];
|
||||||
|
for (int b = 0, N = messageObjects.size(); b < N; b++) {
|
||||||
|
MessageObject messageObject = messageObjects.get(b);
|
||||||
|
int mid = messageObject.getId();
|
||||||
|
int type = MediaDataController.getMediaType(messageObject.messageOwner);
|
||||||
|
for (int a = 0; a < sharedMediaData.length; a++) {
|
||||||
|
MessageObject old = sharedMediaData[a].messagesDict[loadIndex].get(mid);
|
||||||
|
if (old != null) {
|
||||||
|
int oldType = MediaDataController.getMediaType(messageObject.messageOwner);
|
||||||
|
if (type == -1 || oldType != type) {
|
||||||
|
sharedMediaData[a].deleteMessage(mid, loadIndex);
|
||||||
|
if (loadIndex == 0) {
|
||||||
|
if (mediaCount[a] > 0) {
|
||||||
|
mediaCount[a]--;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (mediaMergeCount[a] > 0) {
|
||||||
|
mediaMergeCount[a]--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
int idx = sharedMediaData[a].messages.indexOf(old);
|
||||||
|
if (idx >= 0) {
|
||||||
|
sharedMediaData[a].messagesDict[loadIndex].put(mid, messageObject);
|
||||||
|
sharedMediaData[a].messages.set(idx, messageObject);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue