From 870fab1a9a147b61f9b3187499d3b3cfdc1f5c97 Mon Sep 17 00:00:00 2001 From: luvletter2333 Date: Thu, 25 Mar 2021 22:20:35 +0800 Subject: [PATCH] Improve ignore blocked: load Username from local cache --- .../src/main/java/org/telegram/ui/Cells/DialogCell.java | 2 +- .../src/main/java/tw/nekomimi/nekogram/MessageHelper.java | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/DialogCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/DialogCell.java index 8ee291b46..86bc7c8b5 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/DialogCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/DialogCell.java @@ -2427,7 +2427,7 @@ public class DialogCell extends BaseCell { } // if (width / 2 < AndroidUtilities.dp(40)) { - // canvas.drawText(swipeMessage, getMeasuredWidth() - AndroidUtilities.dp(43) - width / 2, AndroidUtilities.dp(useForceThreeLines || SharedConfig.useThreeLinesLayout ? 62 : 59), Theme.dialogs_archiveTextPaint); + // canvas.drawText(swipeMessage, getMeasuredWidth() - AndroidUtilities.dp(43) - width / 2, AndroidUtilities.dp(useForceThreeLines || SharedConfig.useThreeLinesLayout ? 62 : 59), Theme.dialogs_archiveTextPaint); // } canvas.restore(); diff --git a/TMessagesProj/src/main/java/tw/nekomimi/nekogram/MessageHelper.java b/TMessagesProj/src/main/java/tw/nekomimi/nekogram/MessageHelper.java index 9b1cf0955..59f58090b 100644 --- a/TMessagesProj/src/main/java/tw/nekomimi/nekogram/MessageHelper.java +++ b/TMessagesProj/src/main/java/tw/nekomimi/nekogram/MessageHelper.java @@ -323,6 +323,12 @@ public class MessageHelper extends BaseController { message.id = cursor.intValue(2); message.date = cursor.intValue(3); message.dialog_id = dialogId; + // Fix username show + if (getMessagesController().getUser(ret.getSenderId()) == null) { + TLRPC.User user = getMessagesStorage().getUser(ret.getSenderId()); + if (user != null) + getMessagesController().putUser(user, true); + } break; } }