Fix "Hide phone number"
This commit is contained in:
@@ -16,6 +16,7 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import org.telegram.messenger.AndroidUtilities;
|
||||
import org.telegram.messenger.LocaleController;
|
||||
import org.telegram.messenger.NotificationCenter;
|
||||
import org.telegram.messenger.R;
|
||||
import org.telegram.messenger.SharedConfig;
|
||||
import org.telegram.ui.ActionBar.ActionBar;
|
||||
@@ -142,6 +143,8 @@ public class AppearancePreferencesEntry extends BaseFragment {
|
||||
if (view instanceof TextCheckCell) {
|
||||
((TextCheckCell) view).setChecked(ExteraConfig.hidePhoneNumber);
|
||||
}
|
||||
parentLayout.rebuildAllFragmentViews(false, false);
|
||||
getNotificationCenter().postNotificationName(NotificationCenter.mainUserInfoChanged);
|
||||
} else if (position == showIDRow) {
|
||||
ExteraConfig.toggleShowID();
|
||||
if (view instanceof TextCheckCell) {
|
||||
@@ -296,8 +299,7 @@ public class AppearancePreferencesEntry extends BaseFragment {
|
||||
return 2;
|
||||
} else if (position == useSystemFontsRow || position == useSystemEmojiRow || position == transparentStatusBarRow ||
|
||||
position == blurForAllThemesRow || position == hideAllChatsRow || position == hidePhoneNumberRow ||
|
||||
position == showIDRow || position == chatsOnTitleRow || position == disableVibrationRow ||
|
||||
position == disableVibrationRow) {
|
||||
position == showIDRow || position == chatsOnTitleRow || position == disableVibrationRow) {
|
||||
return 3;
|
||||
}
|
||||
return 1;
|
||||
|
||||
@@ -5863,7 +5863,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
||||
setAvatarSectionRow = rowCount++;
|
||||
}
|
||||
numberSectionRow = rowCount++;
|
||||
numberRow = ExteraConfig.hidePhoneNumber ? -1 : rowCount++;
|
||||
numberRow = rowCount++;
|
||||
setUsernameRow = rowCount++;
|
||||
bioRow = rowCount++;
|
||||
|
||||
@@ -7430,8 +7430,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
||||
if (position == phoneRow) {
|
||||
String text;
|
||||
final TLRPC.User user = getMessagesController().getUser(userId);
|
||||
if (!TextUtils.isEmpty(user.phone)
|
||||
&& !(ExteraConfig.hidePhoneNumber && user.id == UserConfig.getInstance(currentAccount).getClientUserId())) {
|
||||
if (!TextUtils.isEmpty(user.phone) && !(ExteraConfig.hidePhoneNumber && user.id == UserConfig.getInstance(currentAccount).getClientUserId())) {
|
||||
text = PhoneFormat.getInstance().format("+" + user.phone);
|
||||
} else {
|
||||
text = LocaleController.getString("PhoneHidden", R.string.PhoneHidden);
|
||||
@@ -7469,7 +7468,9 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
||||
} else if (position == numberRow) {
|
||||
TLRPC.User user = UserConfig.getInstance(currentAccount).getCurrentUser();
|
||||
String value;
|
||||
if (user != null && user.phone != null && user.phone.length() != 0) {
|
||||
if (ExteraConfig.hidePhoneNumber) {
|
||||
value = LocaleController.getString("MobileHidden", R.string.MobileHidden);
|
||||
} else if (user != null && user.phone != null && user.phone.length() != 0) {
|
||||
value = PhoneFormat.getInstance().format("+" + user.phone);
|
||||
} else {
|
||||
value = LocaleController.getString("NumberUnknown", R.string.NumberUnknown);
|
||||
|
||||
Reference in New Issue
Block a user