From 6f6dabc6f2db105a9a1455ac88a818118a6cade7 Mon Sep 17 00:00:00 2001 From: 030 <030@notfound.404> Date: Wed, 22 Nov 2023 18:10:04 +0800 Subject: [PATCH] fix build --- .../messenger/MessagesController.java | 38 ++++++++++--------- .../tw/nekomimi/nekogram/utils/PrivacyUtil.kt | 4 +- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java b/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java index f7146e9a8e..f02ddacc3a 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java @@ -7624,20 +7624,22 @@ private void checkPromoInfoInternal(boolean reset) { } objects.add(messageObject); dialogMessage.put(did, objects); - if (promoDialog.last_message_date == 0) { - promoDialog.last_message_date = messageObject.messageOwner.date; - } - getTranslateController().checkDialogMessage(did); - } - sortDialogs(null); - getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, true); - }); - } else { - AndroidUtilities.runOnUIThread(() -> { - if (promoDialog != null) { - if (promoDialog.id < 0) { - TLRPC.Chat chat = getChat(-promoDialog.id); - if (ChatObject.isNotInChat(chat) || chat.restricted) { + if (promoDialog.last_message_date == 0) { + promoDialog.last_message_date = messageObject.messageOwner.date; + } + getTranslateController().checkDialogMessage(did);} + sortDialogs(null); + getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload, true); + }); + } else { + AndroidUtilities.runOnUIThread(() -> { + if (promoDialog != null) { + if (promoDialog.id < 0) { + TLRPC.Chat chat = getChat(-promoDialog.id); + if (ChatObject.isNotInChat(chat) || chat.restricted) { + removeDialog(promoDialog); + } + } else { removeDialog(promoDialog); } promoDialog = null; @@ -17211,17 +17213,17 @@ private boolean canAddToForward(TLRPC.Dialog d) { if (DialogObject.isEncryptedDialog(d.id)) { return true; } - boolean _canAddToForward = true; + boolean canAddToForward = true; if (DialogObject.isChannel(d)) { TLRPC.Chat chat = getChat(-d.id); if (chat != null && chat.megagroup) { - _canAddToForward = !chat.gigagroup || ChatObject.hasAdminRights(chat); + canAddToForward = !chat.gigagroup || ChatObject.hasAdminRights(chat); } else { dialogsChannelsOnly.add(d); - _canAddToForward = ChatObject.hasAdminRights(chat) && ChatObject.canPost(chat); + canAddToForward = ChatObject.hasAdminRights(chat) && ChatObject.canPost(chat); } } - return _canAddToForward; + return canAddToForward; } public void sortDialogs(LongSparseArray chatsDict) { diff --git a/TMessagesProj/src/main/java/tw/nekomimi/nekogram/utils/PrivacyUtil.kt b/TMessagesProj/src/main/java/tw/nekomimi/nekogram/utils/PrivacyUtil.kt index acf6c0b638..ef9d5c28c4 100644 --- a/TMessagesProj/src/main/java/tw/nekomimi/nekogram/utils/PrivacyUtil.kt +++ b/TMessagesProj/src/main/java/tw/nekomimi/nekogram/utils/PrivacyUtil.kt @@ -223,7 +223,7 @@ object PrivacyUtil { runCatching { - (builder.show().getButton(DialogInterface.BUTTON_NEUTRAL) as TextView?)?.setTextColor(Theme.getColor(Theme.key_dialogTextRed)) + (builder.show().getButton(DialogInterface.BUTTON_NEUTRAL) as TextView?)?.setTextColor(Theme.getColor(Theme.key_text_RedBold)) } @@ -261,7 +261,7 @@ object PrivacyUtil { runCatching { - (builder.show().getButton(DialogInterface.BUTTON_NEUTRAL) as TextView?)?.setTextColor(Theme.getColor(Theme.key_dialogTextRed)) + (builder.show().getButton(DialogInterface.BUTTON_NEUTRAL) as TextView?)?.setTextColor(Theme.getColor(Theme.key_text_RedBold)) }