From d891f71f0fd3069c82518e2d2f60cd690f9bfdce Mon Sep 17 00:00:00 2001 From: Next Alone <12210746+NextAlone@users.noreply.github.com> Date: Sun, 29 Dec 2024 01:21:36 +0800 Subject: [PATCH] feat: hide phone number in MyProfile Signed-off-by: Next Alone <12210746+NextAlone@users.noreply.github.com> --- .../java/org/telegram/ui/ProfileActivity.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ProfileActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ProfileActivity.java index 8a7d9f9c1..affc6ccc3 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ProfileActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ProfileActivity.java @@ -11762,12 +11762,17 @@ public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { String text; TLRPC.User user = getMessagesController().getUser(userId); String phoneNumber; - if (user != null && !TextUtils.isEmpty(vcardPhone)) { - text = PhoneFormat.getInstance().format("+" + vcardPhone); - phoneNumber = vcardPhone; - } else if (user != null && !TextUtils.isEmpty(user.phone)) { - text = PhoneFormat.getInstance().format("+" + user.phone); - phoneNumber = user.phone; + if (!Config.hidePhone) { + if (user != null && !TextUtils.isEmpty(vcardPhone)) { + text = PhoneFormat.getInstance().format("+" + vcardPhone); + phoneNumber = vcardPhone; + } else if (user != null && !TextUtils.isEmpty(user.phone)) { + text = PhoneFormat.getInstance().format("+" + user.phone); + phoneNumber = user.phone; + } else { + text = LocaleController.getString(R.string.PhoneHidden); + phoneNumber = null; + } } else { text = LocaleController.getString(R.string.PhoneHidden); phoneNumber = null;