Update to 5.15.0 (1869)

This commit is contained in:
DrKLO 2020-02-15 21:17:30 +03:00
parent dae819b5a3
commit df90eface5
7 changed files with 54 additions and 5 deletions

View File

@ -283,7 +283,7 @@ android {
}
}
defaultConfig.versionCode = 1868
defaultConfig.versionCode = 1869
applicationVariants.all { variant ->
variant.outputs.all { output ->

View File

@ -3074,7 +3074,7 @@ static void initMachTimestart() {
double VoIPController::GetCurrentTime(){
#if defined(__linux__)
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
clock_gettime(CLOCK_BOOTTIME, &ts);
return ts.tv_sec+(double)ts.tv_nsec/1000000000.0;
#elif defined(__APPLE__)
static pthread_once_t token = PTHREAD_ONCE_INIT;

View File

@ -552,7 +552,7 @@ int64_t ConnectionsManager::getCurrentTimeMillis() {
}
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;
}

View File

@ -19,7 +19,7 @@ public class BuildVars {
public static boolean USE_CLOUD_STRINGS = true;
public static boolean CHECK_UPDATES = true;
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 int APP_ID = 4;
public static String APP_HASH = "014b35b6184100b085b0d0572f9b5103";

View File

@ -7390,6 +7390,13 @@ public class MessagesStorage extends BaseController {
state_media.bindInteger(4, MediaDataController.getMediaType(message));
state_media.bindByteBuffer(5, data);
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();

View File

@ -7211,11 +7211,14 @@ public class Theme {
return getDefaultColor(key);
}
}
if (key.equals(key_windowBackgroundWhite) || key.equals(key_windowBackgroundGray)) {
return 0xff000000 | color;
}
return color;
}
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;
}

View File

@ -202,6 +202,7 @@ public class SharedMediaLayout extends FrameLayout implements NotificationCenter
notificationCenter.addObserver(this, NotificationCenter.messageReceivedByServer);
notificationCenter.addObserver(this, NotificationCenter.mediaDidLoad);
notificationCenter.addObserver(this, NotificationCenter.messagesDeleted);
notificationCenter.addObserver(this, NotificationCenter.replaceMessagesObjects);
}
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.mediaDidLoad);
notificationCenter.removeObserver(this, NotificationCenter.messagesDeleted);
notificationCenter.removeObserver(this, NotificationCenter.replaceMessagesObjects);
}
public int[] getLastMediaCount() {
@ -391,6 +393,43 @@ public class SharedMediaLayout extends FrameLayout implements NotificationCenter
}
}
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;
}
}
}
}
}