From feaf6c32d82a438f19b79103e90a2ceb3cab9c69 Mon Sep 17 00:00:00 2001 From: DrKLO Date: Wed, 16 Jul 2014 01:27:28 +0400 Subject: [PATCH] Bug fixes --- .../org/telegram/android/MessagesController.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/TMessagesProj/src/main/java/org/telegram/android/MessagesController.java b/TMessagesProj/src/main/java/org/telegram/android/MessagesController.java index e631586e2..0505dd7aa 100644 --- a/TMessagesProj/src/main/java/org/telegram/android/MessagesController.java +++ b/TMessagesProj/src/main/java/org/telegram/android/MessagesController.java @@ -2271,6 +2271,8 @@ public class MessagesController implements NotificationCenter.NotificationCenter } sentMessage.message = newMsg.message; sentMessage.attachPath = newMsg.attachPath; + newMsg.media.photo.id = sentMessage.media.photo.id; + newMsg.media.photo.access_hash = sentMessage.media.photo.access_hash; } else if (sentMessage.media instanceof TLRPC.TL_messageMediaVideo && sentMessage.media.video != null && newMsg.media instanceof TLRPC.TL_messageMediaVideo && newMsg.media.video != null) { MessagesStorage.getInstance().putSentFile(originalPath, sentMessage.media.video, 2); @@ -2289,6 +2291,9 @@ public class MessagesController implements NotificationCenter.NotificationCenter } sentMessage.message = newMsg.message; sentMessage.attachPath = newMsg.attachPath; + newMsg.media.video.dc_id = sentMessage.media.video.dc_id; + newMsg.media.video.id = sentMessage.media.video.id; + newMsg.media.video.access_hash = sentMessage.media.video.access_hash; } else if (sentMessage.media instanceof TLRPC.TL_messageMediaDocument && sentMessage.media.document != null && newMsg.media instanceof TLRPC.TL_messageMediaDocument && newMsg.media.document != null) { MessagesStorage.getInstance().putSentFile(originalPath, sentMessage.media.document, 1); @@ -2311,8 +2316,6 @@ public class MessagesController implements NotificationCenter.NotificationCenter boolean result = cacheFile.renameTo(cacheFile2); if (result) { newMsg.attachPath = null; - newMsg.media.document.dc_id = sentMessage.media.document.dc_id; - newMsg.media.document.id = sentMessage.media.document.id; } else { sentMessage.attachPath = newMsg.attachPath; sentMessage.message = newMsg.message; @@ -2321,6 +2324,9 @@ public class MessagesController implements NotificationCenter.NotificationCenter sentMessage.attachPath = newMsg.attachPath; sentMessage.message = newMsg.message; } + newMsg.media.document.dc_id = sentMessage.media.document.dc_id; + newMsg.media.document.id = sentMessage.media.document.id; + newMsg.media.document.access_hash = sentMessage.media.document.access_hash; } else if (sentMessage.media instanceof TLRPC.TL_messageMediaAudio && sentMessage.media.audio != null && newMsg.media instanceof TLRPC.TL_messageMediaAudio && newMsg.media.audio != null) { sentMessage.message = newMsg.message; sentMessage.attachPath = newMsg.attachPath; @@ -2331,9 +2337,10 @@ public class MessagesController implements NotificationCenter.NotificationCenter File cacheFile = new File(AndroidUtilities.getCacheDir(), fileName); File cacheFile2 = new File(AndroidUtilities.getCacheDir(), fileName2); cacheFile.renameTo(cacheFile2); - newMsg.media.audio.dc_id = sentMessage.media.audio.dc_id; - newMsg.media.audio.id = sentMessage.media.audio.id; } + newMsg.media.audio.dc_id = sentMessage.media.audio.dc_id; + newMsg.media.audio.id = sentMessage.media.audio.id; + newMsg.media.audio.access_hash = sentMessage.media.audio.access_hash; } } else if (file != null) { if (newMsg.media instanceof TLRPC.TL_messageMediaPhoto && newMsg.media.photo != null) {