From a0eb876c7bd5ebf4592cbc4f776362c6fa5dd715 Mon Sep 17 00:00:00 2001 From: DrKLO Date: Sat, 12 Jul 2014 18:50:12 +0400 Subject: [PATCH] Bug fixes --- .../org/telegram/android/MessagesController.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/TMessagesProj/src/main/java/org/telegram/android/MessagesController.java b/TMessagesProj/src/main/java/org/telegram/android/MessagesController.java index 8b9aa308e..0d55c4738 100644 --- a/TMessagesProj/src/main/java/org/telegram/android/MessagesController.java +++ b/TMessagesProj/src/main/java/org/telegram/android/MessagesController.java @@ -1535,10 +1535,6 @@ public class MessagesController implements NotificationCenter.NotificationCenter req.max_id = max_positive_id; req.offset = offset; if (offset == 0) { - HashMap dialogsToUpdate = new HashMap(); - dialogsToUpdate.put(dialog_id, 0); - NotificationsController.getInstance().processDialogsUpdateRead(dialogsToUpdate, true); - NotificationsController.getInstance().processReadMessages(null, dialog_id, 0, max_id); MessagesStorage.getInstance().processPendingRead(dialog_id, max_positive_id, max_date, false); MessagesStorage.getInstance().storageQueue.postRunnable(new Runnable() { @@ -1556,6 +1552,9 @@ public class MessagesController implements NotificationCenter.NotificationCenter }); } }); + HashMap dialogsToUpdate = new HashMap(); + dialogsToUpdate.put(dialog_id, 0); + NotificationsController.getInstance().processDialogsUpdateRead(dialogsToUpdate, true); } if (req.max_id != Integer.MAX_VALUE) { ConnectionsManager.getInstance().performRpc(req, new RPCRequest.RPCRequestDelegate() { @@ -1624,10 +1623,6 @@ public class MessagesController implements NotificationCenter.NotificationCenter } MessagesStorage.getInstance().processPendingRead(dialog_id, max_id, max_date, false); - HashMap dialogsToUpdate = new HashMap(); - dialogsToUpdate.put(dialog_id, 0); - NotificationsController.getInstance().processDialogsUpdateRead(dialogsToUpdate, true); - MessagesStorage.getInstance().storageQueue.postRunnable(new Runnable() { @Override public void run() { @@ -1644,6 +1639,10 @@ public class MessagesController implements NotificationCenter.NotificationCenter } }); + HashMap dialogsToUpdate = new HashMap(); + dialogsToUpdate.put(dialog_id, 0); + NotificationsController.getInstance().processDialogsUpdateRead(dialogsToUpdate, true); + if (chat.ttl > 0 && was) { int serverTime = Math.max(ConnectionsManager.getInstance().getCurrentTime(), max_date); MessagesStorage.getInstance().createTaskForDate(chat.id, serverTime, serverTime, 0);