From 10ee81f466f75a06c6ef84b581c54560266592b3 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 4 Jul 2019 10:36:48 +0200 Subject: [PATCH] Copy shared contact number from the context menu. Fixes #6147. --- Telegram/SourceFiles/history/history_inner_widget.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Telegram/SourceFiles/history/history_inner_widget.cpp b/Telegram/SourceFiles/history/history_inner_widget.cpp index feaa317033..4f5a004605 100644 --- a/Telegram/SourceFiles/history/history_inner_widget.cpp +++ b/Telegram/SourceFiles/history/history_inner_widget.cpp @@ -1703,6 +1703,11 @@ void HistoryInner::showContextMenu(QContextMenuEvent *e, bool showFromTouch) { }); } } + } else if (const auto contact = media->sharedContact()) { + const auto phone = contact->phoneNumber; + _menu->addAction(tr::lng_profile_copy_phone(tr::now), [=] { + QApplication::clipboard()->setText(phone); + }); } } if (msg && view && !link && (view->hasVisibleText() || mediaHasTextForCopy)) {