mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
Changed behavior to copy phone number from profile sections as trimmed.
This commit is contained in:
@@ -1150,7 +1150,19 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupInfo() {
|
||||
PhoneOrHiddenValue(user),
|
||||
tr::lng_profile_copy_phone(tr::now)).text;
|
||||
const auto hook = [=](Ui::FlatLabel::ContextMenuRequest request) {
|
||||
phoneLabel->fillContextMenu(request);
|
||||
if (request.selection.empty()) {
|
||||
const auto callback = [=] {
|
||||
auto phone = rpl::variable<TextWithEntities>(
|
||||
PhoneOrHiddenValue(user)).current().text;
|
||||
phone.replace(' ', QString()).replace('-', QString());
|
||||
TextUtilities::SetClipboardText({ phone });
|
||||
};
|
||||
request.menu->addAction(
|
||||
tr::lng_profile_copy_phone(tr::now),
|
||||
callback);
|
||||
} else {
|
||||
phoneLabel->fillContextMenu(request);
|
||||
}
|
||||
AddPhoneMenu(request.menu, user);
|
||||
};
|
||||
phoneLabel->setContextMenuHook(hook);
|
||||
|
Reference in New Issue
Block a user