From f563fbbb0518f81c9055368d4f913915e7066a38 Mon Sep 17 00:00:00 2001 From: DrKLO Date: Wed, 25 May 2016 16:27:33 -0700 Subject: [PATCH] Bug fixes --- .../main/java/org/telegram/messenger/MessagesController.java | 2 +- .../java/org/telegram/messenger/NotificationsController.java | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java b/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java index 51a2bbc89..3315783c4 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java @@ -5787,7 +5787,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter } } - long dialog_id = -update.channel_id; + long dialog_id = -message.to_id.channel_id; Integer value = dialogs_read_inbox_max.get(dialog_id); if (value == null) { value = MessagesStorage.getInstance().getDialogReadInboxMax(dialog_id); diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/NotificationsController.java b/TMessagesProj/src/main/java/org/telegram/messenger/NotificationsController.java index fd4d004ba..736062cd2 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/NotificationsController.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/NotificationsController.java @@ -411,12 +411,15 @@ public class NotificationsController { Boolean value = settingsCache.get(dialog_id); boolean isChat = (int) dialog_id < 0; - popup = (int)dialog_id == 0 ? 0 : preferences.getInt(isChat ? "popupGroup" : "popupAll", 0); + popup = (int) dialog_id == 0 ? 0 : preferences.getInt(isChat ? "popupGroup" : "popupAll", 0); if (value == null) { int notifyOverride = getNotifyOverride(preferences, dialog_id); value = !(notifyOverride == 2 || (!preferences.getBoolean("EnableAll", true) || isChat && !preferences.getBoolean("EnableGroup", true)) && notifyOverride == 0); settingsCache.put(dialog_id, value); } + if (popup != 0 && messageObject.messageOwner.to_id.channel_id != 0 && !messageObject.isMegagroup()) { + popup = 0; + } if (value) { if (popup != 0) { popupArray.add(0, messageObject);